Skip to content

Commit

Permalink
isolated step with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Apr 8, 2024
1 parent edaa769 commit bd033a5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
- name: Skip merge queue
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
run: exit 0
- name: Get users who commented
id: comments
run: echo "users=$(gh pr view ${{ github.event.number }} --repo ${{ github.repository }} --json comments --jq \".comments[].author.login\")" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Fail when author pushes new code
id: fail
# Require new reviews when the author is pushing and he is not a member
Expand All @@ -36,9 +41,6 @@ jobs:
echo "Repo is ${{ github.repository }} and actor is ${{ github.actor }}"
# We get the users who comment
COMMENTS=$(gh pr view ${{ github.event.number }} --repo ${{ github.repository }} --json comments --jq ".comments[].author.login")
echo "commenters=$COMMENTS" >> "$GITHUB_OUTPUT"
echo "Commeneters are $COMMENTS"
echo "::error::Project needs to be reviewed again"
Expand All @@ -48,14 +50,15 @@ jobs:
exit 1
env:
GH_TOKEN: ${{ github.token }}
COMMENTS: ${{ steps.comments.outputs.users }}
- name: Comment requirements
if: failure() && !contains(steps.fail.output.commenters, 'github-actions')
if: failure() && !contains(steps.comments.outputs.users, 'github-actions')
run: |
echo "Commeneters are $COMMENTS"
gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body "PR needs to be reviewed again after being modified"
env:
GH_TOKEN: ${{ github.token }}
COMMENTS: ${{ steps.fail.output.commenters }}
COMMENTS: ${{ steps.comments.outputs.users }}
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down

0 comments on commit bd033a5

Please sign in to comment.