Fix comment workflow (#103)

main
Kirill Sizov 4 years ago committed by GitHub
parent 388237720a
commit edaa57fd7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,13 +21,15 @@ jobs:
- name: Check author of comment
id: check-author
run: |
COLLABORATOR=$(gh api repos/${{ github.repository }}/collaborators | jq ".[] | select((.login == \"${{ github.event.comment.user.login }}\"))")
echo Author of comment: ${COLLABORATOR}
echo ::set-output name=collaborator::${COLLABORATOR}
PERM=$(gh api repos/${{ github.repository }}/collaborators/${{ github.event.comment.user.login }}/permission | jq -r '.permission')
if [[ $PERM == "write" || $PERM == "maintain" || $PERM == "admin" ]];
then
ALLOW="true"
fi
echo ::set-output name=allow::${ALLOW}
- name: Verify that author of comment is collaborator
if: steps.check-author.outputs.collaborator == ''
if: steps.check-author.outputs.allow == ''
uses: actions/github-script@v3
with:
script: |

Loading…
Cancel
Save