Skip to content

Commit 0b63162

Browse files
authored
Add explicit GITHUB_TOKEN permissions to workflow callers
Resolves the three open `actions/missing-workflow-permissions` CodeQL alerts (#1, #3, #4). Each is a single-job caller of a reusable workflow in rubyatscale/shared-config, so the permissions block goes job-level, right above `uses:`, matching the query_packwerk precedent. A caller's block is the ceiling for the called workflow, so each grant covers exactly what the callee does and nothing more. - cd.yml -> contents: write. shared-config's cd.yml checks out with persisted credentials and runs discourse/publish-rubygems-action, which does `rake release` (a raw git push of the version tag), then `gh release create`. Anything less breaks the gem release. - stale.yml -> issues: write + pull-requests: write. shared-config's stale.yml runs actions/stale, which comments on and closes both stale issues and stale PRs. The implicit read of repo contents still works without naming contents. - triage.yml -> issues: write. shared-config's triage.yml only runs `gh issue edit --add-label triage`. ci.yml already declares workflow-level `contents: read` and codeql.yml already declares its own block, so both are left untouched.
1 parent 1dc4089 commit 0b63162

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/cd.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ on:
88

99
jobs:
1010
call-workflow-from-shared-config:
11+
permissions:
12+
contents: write
1113
uses: rubyatscale/shared-config/.github/workflows/cd.yml@main
1214
secrets: inherit

.github/workflows/stale.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ on:
55
- cron: '0 0 * * *'
66
jobs:
77
call-workflow-from-shared-config:
8+
permissions:
9+
issues: write
10+
pull-requests: write
811
uses: rubyatscale/shared-config/.github/workflows/stale.yml@main

.github/workflows/triage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ on:
66
- opened
77
jobs:
88
call-workflow-from-shared-config:
9+
permissions:
10+
issues: write
911
uses: rubyatscale/shared-config/.github/workflows/triage.yml@main

0 commit comments

Comments
 (0)