Skip to content

Commit

Permalink
explicit perms on workflow_run to read artifact, write comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jbolda committed Jun 25, 2024
1 parent f44fa9e commit 6cee638
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/comment-on-forks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
types:
- completed

# note all other permissions are set to none if not specified
permissions:
# to read the action artifacts
actions: read
# to write the comment
pull-requests: write

jobs:
download:
runs-on: ubuntu-latest
Expand All @@ -17,7 +24,9 @@ jobs:
- name: covector status
uses: jbolda/covector/packages/action@release
id: covector
if: github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]')
# note that this could be shifted to the job, but for future reference we are dumping the full github context
if: github.event.workflow_run.conclusion == 'success' &&
(github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]')
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: "status"

0 comments on commit 6cee638

Please sign in to comment.