Skip to content

Commit

Permalink
update command permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Aug 15, 2023
1 parent aa78687 commit 403d776
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,37 @@ jobs:
- name: Fail if needs-triage label applied
if: ${{ contains(github.event.issue.labels.*.name, 'needs-triage') }}
run: exit 1
- name: Check command permission allowed
- name: Show warning if permission is denied
if: |
github.event.comment.author_association != 'MEMBER' &&
github.event.comment.author_association != 'OWNER' &&
!contains(github.event.issue.labels.*.name, 'safe-to-test')
!(github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER')
&& !contains(github.event.issue.labels.*.name, 'safe-to-test')
uses: thollander/actions-comment-pull-request@v2
with:
message: |-
You do not have permission to run the /build_test command. Please ask Cryostat @reviewers
to resolve the issue.
- name: Fail if command permission is not allowed
if: |
github.event.comment.author_association != 'MEMBER' &&
github.event.comment.author_association != 'OWNER' &&
!contains(github.event.issue.labels.*.name, 'safe-to-test')
!(github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER')
&& !contains(github.event.issue.labels.*.name, 'safe-to-test')
run: exit 1
- name: Show warning if safe-to-test applied and permission denied
if: |
!(github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER' ||
github.event.issue.user.name == github.event.comment.user.name)
uses: thollander/actions-comment-pull-request@v2
with:
message: |-
You do not have permission to run the /build_test command. Please ask Cryostat @reviewers
to resolve the issue.
- name: Fail if safe-to-test applied and command permission is not allowed
if: |
!(github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER' ||
github.event.issue.user.name == github.event.comment.user.name)
run: exit 1
- name: React to comment
uses: actions/github-script@v4
Expand Down

0 comments on commit 403d776

Please sign in to comment.