Skip to content

Commit

Permalink
Merge pull request #188 from pangaeatech/autoApprove
Browse files Browse the repository at this point in the history
Updated auto approve example to minimizing notifications
  • Loading branch information
brrygrdn committed Mar 29, 2022
2 parents ba6223c + fb30fa3 commit d76b431
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -96,8 +96,14 @@ jobs:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.3.0
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
- uses: actions/checkout@v3
- name: Approve a PR if not already approved
run: |
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status`
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
then gh pr review --approve "$PR_URL"
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
fi
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down

0 comments on commit d76b431

Please sign in to comment.