Skip to content

Add explicit GITHUB_TOKEN permissions to workflows - #177

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

Add explicit GITHUB_TOKEN permissions to workflows#177
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 10 open actions/missing-workflow-permissions CodeQL alerts
(#1, #6-#14) by giving every job an explicit least-privilege scope.

ci.yml: one workflow-level contents: read. All five jobs (ci-data,
rspec, rspec_ruby_version_file, static_type_check, notify_on_failure)
only check out the repo and run rake/srb, or post to a Slack incoming
webhook — none of them writes anything back to GitHub.

cd.yml: one workflow-level contents: read covering check-release
(sparse checkout + a rubygems.org version probe), ci-data
(oxidize-rb/actions/fetch-ci-data), build (checkout, cross-gem,
upload-artifact) and notify_on_release (Slack webhook). The release
job keeps its existing job-level contents: write override, which it
needs for gh release create; job-level permissions replace rather
than intersect the workflow-level block for normal jobs, so the release
path is unaffected.

stale.yml: job-level issues: write + pull-requests: write on the
shared-config caller. A caller's permissions are the ceiling for the
called workflow, and shared-config's stale.yml runs actions/stale,
which comments on and closes both stale issues and stale PRs.

Alerts resolved

  • #14 actions/missing-workflow-permissions (medium) — .github/workflows/cd.yml:235
  • #13 actions/missing-workflow-permissions (medium) — .github/workflows/cd.yml:77
  • #12 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:59
  • #11 actions/missing-workflow-permissions (medium) — .github/workflows/cd.yml:57
  • #10 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:45
  • #9 actions/missing-workflow-permissions (medium) — .github/workflows/cd.yml:22
  • #8 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:23
  • #7 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:11
  • #6 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:70
  • #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.
  • I bumped the gem version (or don't need to) 💎

Resolves the 10 open `actions/missing-workflow-permissions` CodeQL alerts
(#1, #6-#14) by giving every job an explicit least-privilege scope.

ci.yml: one workflow-level `contents: read`. All five jobs (ci-data,
rspec, rspec_ruby_version_file, static_type_check, notify_on_failure)
only check out the repo and run rake/srb, or post to a Slack incoming
webhook — none of them writes anything back to GitHub.

cd.yml: one workflow-level `contents: read` covering check-release
(sparse checkout + a rubygems.org version probe), ci-data
(oxidize-rb/actions/fetch-ci-data), build (checkout, cross-gem,
upload-artifact) and notify_on_release (Slack webhook). The `release`
job keeps its existing job-level `contents: write` override, which it
needs for `gh release create`; job-level permissions replace rather
than intersect the workflow-level block for normal jobs, so the release
path is unaffected.

stale.yml: job-level `issues: write` + `pull-requests: write` on the
shared-config caller. A caller's permissions are the ceiling for the
called workflow, and shared-config's stale.yml runs actions/stale,
which comments on and closes both stale issues and stale PRs.
@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 f91e149 into main Aug 17, 2026
14 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