use --admin flag to bypass approvals

This commit is contained in:
Kenneth Kehl
2025-03-12 13:13:49 -07:00
parent aede24b14d
commit 2c76d267c6
+9 -8
View File
@@ -27,18 +27,19 @@ on:
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve minor updates # - name: Approve minor updates
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' # if: steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: | # run: |
gh pr review "$PR_URL" --approve -b "Auto-approved minor update" # gh pr review "$PR_URL" --approve -b "Auto-approved minor update"
env: # env:
PR_URL: ${{ github.event.pull_request.html_url }} # PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# use admin to bypass the need for approval, human PRs still need two approvals
- name: Enable auto-merge for minor updates - name: Enable auto-merge for minor updates
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' if: steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: | run: |
gh pr merge --auto --squash "$PR_URL" gh pr merge --squash --admin "$PR_URL"
env: env:
PR_URL: ${{ github.event.pull_request.html_url }} PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}