From 0871a1e677d998dd5d449101ceef94fa5dc4a1a0 Mon Sep 17 00:00:00 2001 From: tonyhu Date: Mon, 14 Oct 2024 17:47:59 -0700 Subject: [PATCH] fix permission check in CICD (#153) --- .github/workflows/continuous_integration.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 4886554..7836f4e 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -28,8 +28,15 @@ jobs: with: github_token: ${{ github.token }} permission: write + - name: Debug Information + if: ${{ github.event_name == 'pull_request_target' }} + run: | + echo "Event Name: ${{ github.event_name }}" + echo "Labels: ${{ toJson(github.event.pull_request.labels) }}" + echo "Permitted: ${{ steps.check.outputs.permitted }}" + echo "Safe to Test Label Present: ${{ contains(github.event.pull_request.labels.*.name, 'safe to test') }}" - name: Check PR Safe to Run - if: ${{ github.event_name == 'pull_request_target' && (contains(github.event.pull_request.labels.*.name, 'safe to test') == 'false') && steps.check.outputs.permitted == 'false' }} + if: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') && steps.check.outputs.permitted == 'false' }} run: exit 1 - name: Remove Safe to Test Label # One commit is safe doesn't mean the next commit is safe. if: ${{ github.event_name == 'pull_request_target' }}