|
|
@@ -7,25 +7,14 @@ on:
|
|
|
jobs:
|
|
|
check-guidelines:
|
|
|
if: |
|
|
|
- (github.event_name == 'issue_comment' &&
|
|
|
- github.event.issue.pull_request &&
|
|
|
- startsWith(github.event.comment.body, '/review'))
|
|
|
+ github.event.issue.pull_request &&
|
|
|
+ startsWith(github.event.comment.body, '/review') &&
|
|
|
+ contains(fromJson('["OWNER","MEMBER"]'), github.event.comment.author_association)
|
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
|
permissions:
|
|
|
contents: read
|
|
|
pull-requests: write
|
|
|
steps:
|
|
|
- - name: Check if user has write permission
|
|
|
- if: github.event_name == 'issue_comment'
|
|
|
- run: |
|
|
|
- PERMISSION=$(gh api /repos/${{ github.repository }}/collaborators/${{ github.event.comment.user.login }}/permission --jq '.permission')
|
|
|
- if [[ "$PERMISSION" != "write" && "$PERMISSION" != "admin" ]]; then
|
|
|
- echo "User does not have write permission"
|
|
|
- exit 1
|
|
|
- fi
|
|
|
- env:
|
|
|
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
-
|
|
|
- name: Get PR number
|
|
|
id: pr-number
|
|
|
run: |
|