Skip to content

Commit 076108f

Browse files
authored
fix: use PAT for all steps on the comment action (#74)
1 parent 06891cc commit 076108f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/comment.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ on:
1111
types:
1212
- completed
1313

14+
permissions:
15+
actions: read
16+
issues: write
17+
checks: read
18+
statuses: read
19+
pull-requests: write
20+
1421
jobs:
1522
comment:
1623
name: Comment Bot
@@ -21,7 +28,7 @@ jobs:
2128
name: content
2229
path: /tmp/content
2330
run-id: ${{ github.event.workflow_run.id }}
24-
github-token: ${{ secrets.READ_ONLY_PAT }}
31+
github-token: ${{ secrets.READ_ONLY_PAT || github.token }}
2532

2633
- name: Read pr number
2734
id: get_pr_number
@@ -40,6 +47,7 @@ jobs:
4047
with:
4148
issue-number: ${{ steps.get_pr_number.outputs.pr_number }}
4249
comment-author: "github-actions[bot]"
50+
token: ${{ secrets.READ_ONLY_PAT || github.token }}
4351

4452
- name: Create or update pr comment
4553
uses: peter-evans/create-or-update-comment@v4
@@ -49,10 +57,12 @@ jobs:
4957
issue-number: ${{ steps.get_pr_number.outputs.pr_number }}
5058
body-file: /tmp/all.txt
5159
edit-mode: replace
60+
token: ${{ secrets.READ_ONLY_PAT || github.token }}
5261

5362
- name: Create or update commit comment
5463
uses: peter-evans/commit-comment@v3
5564
if: ${{ steps.get_pr_number.outputs.pr_number == null }}
5665
with:
5766
sha: ${{ github.event.workflow_run.head_sha }}
5867
body-file: /tmp/all.txt
68+
token: ${{ secrets.READ_ONLY_PAT || github.token }}

0 commit comments

Comments
 (0)