Skip to content

Commit

Permalink
added list of old commenters
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Apr 8, 2024
1 parent 0441836 commit 78b9034
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
run: exit 0
- name: Fail when author pushes new code
id: fail
# Require new reviews when the author is pushing and he is not a member
if: |
github.event_name == 'pull_request_target' &&
Expand All @@ -34,12 +35,24 @@ jobs:
# We get the list of reviewers who approved the PR
REVIEWERS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.number }}/reviews \
--jq '{reviewers: [.[] | select(.state == "APPROVED") | .user.login]}')
# We get the users who comment
COMMENTS=$(gh pr view ${{ github.event.number }} --json comments --jq ".comments[].author.login")
echo "commenters=COMMENTS" >> "$GITHUB_OUTPUT"
echo "Commeneters are $COMMENTS"
# We request them to review again
echo $REVIEWERS | gh api --method POST repos/${{ github.repository }}/pulls/${{ github.event.number }}/requested_reviewers --input -
exit 1
env:
GH_TOKEN: ${{ github.token }}
- name: Comment requirements
if: failure() && ${{ contains(steps.fail.output.commenters, 'github-action') }}
run: |
echo "OH NO!"
env:
GH_TOKEN: ${{ github.token }}
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down

0 comments on commit 78b9034

Please sign in to comment.