Skip to content

Commit

Permalink
fix: use PAT for all steps on the comment action (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra authored Nov 14, 2024
1 parent 06891cc commit 076108f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ on:
types:
- completed

permissions:
actions: read
issues: write
checks: read
statuses: read
pull-requests: write

jobs:
comment:
name: Comment Bot
Expand All @@ -21,7 +28,7 @@ jobs:
name: content
path: /tmp/content
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.READ_ONLY_PAT }}
github-token: ${{ secrets.READ_ONLY_PAT || github.token }}

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

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

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

0 comments on commit 076108f

Please sign in to comment.