Skip to content

Add explicit GITHUB_TOKEN permissions to workflows - #83

Merged
dduugg merged 1 commit into
mainfrom
fix-code-scanning-alerts
Aug 17, 2026
Merged

Add explicit GITHUB_TOKEN permissions to workflows#83
dduugg merged 1 commit into
mainfrom
fix-code-scanning-alerts

Conversation

@dduugg

@dduugg dduugg commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Resolves the seven open CodeQL actions/missing-workflow-permissions
alerts (#1, #3, #4, #5, #6, #7, #8) by declaring the least privilege
each job actually needs.

ci.yml: one workflow-level contents: read covers run_tests,
static_type_check and run_linter -- each only checks out the repo and
runs rspec / srb tc / rubocop. notify_on_failure gets a job-level
permissions: {}: it never checks out and posts to Slack through an
incoming webhook secret, so it needs no GitHub token scopes at all.

cd.yml: contents: write -- shared-config's cd.yml checks out with
persisted credentials, runs publish-rubygems-action (rake release does a
raw git push of the version tag) and then gh release create.

stale.yml: issues: write + pull-requests: write -- actions/stale
comments on and closes both stale issues and stale PRs.

triage.yml: issues: write -- the called workflow runs
gh issue edit --add-label triage.

A caller's permissions block is the ceiling for the reusable workflow it
calls, so these grants match what shared-config needs rather than being
clamped to read-only.

Alerts resolved

  • #8 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:11
  • #7 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:55
  • #6 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:43
  • #5 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:31
  • #4 actions/missing-workflow-permissions (medium) — .github/workflows/cd.yml:11
  • #3 actions/missing-workflow-permissions (medium) — .github/workflows/triage.yml:9
  • #1 actions/missing-workflow-permissions (medium) — .github/workflows/stale.yml:8

Verification

  • Every job in every flagged workflow now has an effective permissions: block (cross-checked by parsing the YAML against the alert list).
  • actionlint output is byte-identical to main — no new findings introduced.
  • codeql.yml untouched.

Resolves the seven open CodeQL actions/missing-workflow-permissions
alerts (#1, #3, #4, #5, #6, #7, #8) by declaring the least privilege
each job actually needs.

ci.yml: one workflow-level `contents: read` covers run_tests,
static_type_check and run_linter -- each only checks out the repo and
runs rspec / srb tc / rubocop. notify_on_failure gets a job-level
`permissions: {}`: it never checks out and posts to Slack through an
incoming webhook secret, so it needs no GitHub token scopes at all.

cd.yml: `contents: write` -- shared-config's cd.yml checks out with
persisted credentials, runs publish-rubygems-action (rake release does a
raw git push of the version tag) and then `gh release create`.

stale.yml: `issues: write` + `pull-requests: write` -- actions/stale
comments on and closes both stale issues and stale PRs.

triage.yml: `issues: write` -- the called workflow runs
`gh issue edit --add-label triage`.

A caller's permissions block is the ceiling for the reusable workflow it
calls, so these grants match what shared-config needs rather than being
clamped to read-only.
@dduugg
dduugg requested a review from a team as a code owner August 17, 2026 19:34
@github-project-automation github-project-automation Bot moved this to Triage in Modularity Aug 17, 2026
@dduugg
dduugg merged commit d38a603 into main Aug 17, 2026
9 checks passed
@dduugg
dduugg deleted the fix-code-scanning-alerts branch August 17, 2026 19:40
@github-project-automation github-project-automation Bot moved this from Triage to Done in Modularity Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant