Skip to content

Commit 7b3aa5b

Browse files
authored
Auto-approve fix for BOT_PAT (#176)
1 parent a780188 commit 7b3aa5b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/ack.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ jobs:
7575

7676
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
7777
- name: Enable auto-merge for safe bots PRs
78-
if: contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.actor)
78+
if: env.BOT_PAT != null && contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.actor)
7979
run: gh pr merge --auto --squash "$PR_URL"
8080
env:
81-
PR_URL: ${{github.event.pull_request.html_url}}
82-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
81+
PR_URL: ${{ github.event.pull_request.html_url }}
82+
GH_TOKEN: ${{ secrets.BOT_PAT || secrets.GITHUB_TOKEN }}
8383

8484
- name: Approve a PR
85-
if: contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.actor)
85+
if: env.BOT_PAT != null && contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.actor)
8686
run: gh pr review --approve "$PR_URL"
8787
env:
8888
PR_URL: ${{github.event.pull_request.html_url}}
89-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
89+
GH_TOKEN: ${{ secrets.BOT_PAT || secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)