Skip to content

Add explicit GITHUB_TOKEN permissions to ci.yml and audit.yml - #47

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

Add explicit GITHUB_TOKEN permissions to ci.yml and audit.yml#47
dduugg merged 1 commit into
mainfrom
fix-code-scanning-alerts

Conversation

@dduugg

@dduugg dduugg commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Resolves CodeQL actions/missing-workflow-permissions alerts #1, #2, #3, #9.

ci.yml (alerts #1 check, #3 test, #9 lints): all three jobs only check out
the repo and run cargo check / cargo test / cargo fmt + clippy. Nothing
writes back to GitHub, so a single workflow-level contents: read covers
every job.

audit.yml (alert #2): actions-rs/audit-check needs more than read. Its
main.ts branches on the event name -- on schedule it calls
reporter.reportIssues, which does client.issues.create (needs
issues: write); on every other event (push, pull_request here) it
calls reporter.reportCheck, which creates and updates a check run (needs
checks: write). contents: read covers actions/checkout and
cargo generate-lockfile. Scoped at the job rather than the workflow so a
future job added to this file does not inherit the write scopes.

release.yml already declares its own permissions and is not flagged;
codeql.yml is already correct. Both left untouched.

Alerts resolved

  • #9 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:42
  • #3 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:31
  • #2 actions/missing-workflow-permissions (medium) — .github/workflows/audit.yml:14
  • #1 actions/missing-workflow-permissions (medium) — .github/workflows/ci.yml:22

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 CodeQL actions/missing-workflow-permissions alerts #1, #2, #3, #9.

ci.yml (alerts #1 check, #3 test, #9 lints): all three jobs only check out
the repo and run cargo check / cargo test / cargo fmt + clippy. Nothing
writes back to GitHub, so a single workflow-level `contents: read` covers
every job.

audit.yml (alert #2): actions-rs/audit-check needs more than read. Its
main.ts branches on the event name -- on `schedule` it calls
reporter.reportIssues, which does client.issues.create (needs
`issues: write`); on every other event (`push`, `pull_request` here) it
calls reporter.reportCheck, which creates and updates a check run (needs
`checks: write`). `contents: read` covers actions/checkout and
cargo generate-lockfile. Scoped at the job rather than the workflow so a
future job added to this file does not inherit the write scopes.

release.yml already declares its own permissions and is not flagged;
codeql.yml is already correct. Both 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 0ccf146 into main Aug 17, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in Modularity Aug 17, 2026
@dduugg
dduugg deleted the fix-code-scanning-alerts branch August 17, 2026 19:41
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