Skip to content

Commit

Permalink
fix permission check in CICD (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhoo authored Oct 15, 2024
1 parent 3393512 commit 0871a1e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down

0 comments on commit 0871a1e

Please # to comment.