Skip to content

Add explicit GITHUB_TOKEN permissions to workflows - #109

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

Add explicit GITHUB_TOKEN permissions to workflows#109
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 six open actions/missing-workflow-permissions CodeQL alerts
(#1, #2, #4, #6, #7, #8) by declaring the least privilege each job needs.

  • ci.yml: one workflow-level contents: read covers all three jobs. rspec
    and static_type_check only check out the repo and run rspec / srb tc;
    notify_on_failure posts to a Slack incoming webhook and uses no
    GITHUB_TOKEN scope at all.
  • cd.yml: contents: write on the caller job. The shared-config cd workflow
    checks out with persisted credentials and runs
    discourse/publish-rubygems-action (rake release does a raw git push of
    the version tag), then gh release create. A caller-side grant is the
    ceiling for the reusable workflow, so anything less breaks the release.
  • stale.yml: issues: write + pull-requests: write. actions/stale comments
    on and closes both stale issues and stale PRs.
  • triage.yml: issues: write for gh issue edit --add-label triage.

codeql.yml already declares its permissions and is left untouched.

Alerts resolved

  • #8 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:36
  • #7 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:11
  • #6 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:48
  • #4 actions/missing-workflow-permissions (medium) — .github/workflows/cd.yml:11
  • #2 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 six open `actions/missing-workflow-permissions` CodeQL alerts
(#1, #2, #4, #6, #7, #8) by declaring the least privilege each job needs.

- ci.yml: one workflow-level `contents: read` covers all three jobs. `rspec`
  and `static_type_check` only check out the repo and run rspec / `srb tc`;
  `notify_on_failure` posts to a Slack incoming webhook and uses no
  GITHUB_TOKEN scope at all.
- cd.yml: `contents: write` on the caller job. The shared-config cd workflow
  checks out with persisted credentials and runs
  discourse/publish-rubygems-action (`rake release` does a raw `git push` of
  the version tag), then `gh release create`. A caller-side grant is the
  ceiling for the reusable workflow, so anything less breaks the release.
- stale.yml: `issues: write` + `pull-requests: write`. actions/stale comments
  on and closes both stale issues and stale PRs.
- triage.yml: `issues: write` for `gh issue edit --add-label triage`.

codeql.yml already declares its permissions and is left untouched.
@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 8dfa5ae into main Aug 17, 2026
11 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