@@ -26,20 +26,24 @@ jobs:
2626 ignoreActions : " Wait for CI checks,Fix CI failure,Automerge PRs"
2727 checkInterval : 13
2828 env :
29- GITHUB_TOKEN : " ${{ secrets.PHPSTAN_BOT_TOKEN }}"
29+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
3030
3131 fix-ci :
3232 name : " Fix CI failure"
3333 needs : wait-for-checks
3434 if : needs.wait-for-checks.outputs.status == 'failure'
3535 runs-on : blacksmith-4vcpu-ubuntu-2404
3636 timeout-minutes : 60
37+ permissions :
38+ contents : read
39+ actions : read
40+ pull-requests : write
3741
3842 steps :
3943 - name : " Check fix attempt count"
4044 id : check-attempts
4145 env :
42- GH_TOKEN : ${{ secrets.PHPSTAN_BOT_TOKEN }}
46+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4347 PR_NUMBER : ${{ github.event.pull_request.number }}
4448 run : |
4549 COMMITS=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER/commits?per_page=100" \
5862 if : steps.check-attempts.outputs.skip != 'true'
5963 id : failures
6064 env :
61- GH_TOKEN : ${{ secrets.PHPSTAN_BOT_TOKEN }}
65+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6266 HEAD_SHA : ${{ github.event.pull_request.head.sha }}
6367 run : |
6468 FAILED_RUNS=$(gh api "repos/${{ github.repository }}/actions/runs?head_sha=$HEAD_SHA&status=failure&per_page=20" \
@@ -114,7 +118,6 @@ jobs:
114118 with :
115119 ref : ${{ github.head_ref }}
116120 fetch-depth : 0
117- token : ${{ secrets.PHPSTAN_BOT_TOKEN }}
118121
119122 - name : " Install PHP"
120123 if : steps.check-attempts.outputs.skip != 'true' && steps.failures.outputs.skip != 'true'
@@ -196,7 +199,7 @@ jobs:
196199 if : steps.check-attempts.outputs.skip != 'true' && steps.failures.outputs.skip != 'true'
197200 env :
198201 CLAUDE_CODE_OAUTH_TOKEN : ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
199- GH_TOKEN : ${{ secrets.PHPSTAN_BOT_TOKEN }}
202+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
200203 run : |
201204 git config user.name "phpstan-bot"
202205 git config user.email "ondrej+phpstanbot@mirtes.cz"
0 commit comments