ci: 🔒 Scope token on GH workflows - #806
Conversation
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe workflows now use ChangesWorkflow permission scoping
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The workflow permission changes present no actionable merge-blocking risk; the PR is merge-ready after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
clawgenti
left a comment
There was a problem hiding this comment.
This PR correctly applies the principle of least privilege across five GitHub Actions workflows by demoting broad top-level write permissions to the individual jobs that actually require them, while defaulting workflows to contents: read at the top level.
All checks pass. Ready for human review.
Reviewed by clawgenti using the github-pr-review skill
esnible
left a comment
There was a problem hiding this comment.
Least-privilege token scoping across five workflows: top-level permissions drops to contents: read, write scopes move down to the single job that needs them, each with an inline comment explaining why. Also adds the missing top-level permissions block to spellcheck_action.yml.
Areas reviewed: CI/GitHub Actions (YAML)
Agent/IDE config (.claude/.vscode): none
Commits: 1, signed-off: yes
CI status: passing (Spellcheck skipped by design — if: false)
What I verified
- Reusable-workflow calls are correct.
self-assign.ymlandstale.yamlcall org-wide reusables.jobs.<id>.permissionsis valid on auses:job, and the caller's grant is the ceiling — the callee can only downgrade.rossoctl/.github'sstale.yamldeclares no job-level permissions, so it inherits the caller's newissues: write+pull-requests: write.self-assign-reusable.ymldeclarescontents: read+issues: writeon both its jobs, matching the caller's grant exactly. Neither call loses a needed scope. - No sibling jobs starved. Each of the five workflows has exactly one job, so moving scopes down cannot strip permissions from another job in the same file.
dependabot-tidy.ymlretains what it needs. The job doesgit push(contents: write) andgh pr close/reopenviasecrets.GITHUB_TOKEN(pull-requests: write). Both granted at job level.build.yamlkeepspackages: writeon the job that pushes to ghcr.io.- Repo-wide consistency.
spellcheck_action.ymlwas the only workflow in the repo lacking a top-levelpermissions:block; this closes that gap. The pattern matches the existing precedent in the untouchedproject.ymlandrelease-binaries.yaml.
No blocking issues, no suggestions, no nits. Strictly a security improvement with no behavioral regression I could find.
Assisted-By: Claude Code
Summary
Scope token permissions for Github workflows - write scopes mostly moved down to individual jobs
Summary by CodeRabbit