Repository navigation
chore(ci): scope workflow tokens and pin actions to commit SHAs - #674
Merged
Merged
Conversation
Workflows without a `permissions:` block inherited the repository's default token, so test, validation, build and benchmark jobs running on push to main or merge_group held a token that could write releases, tags and branches, while executing third-party actions by mutable reference (dfinity/setup-dfx@main, @vn tags). - tests, validation, builds, benchmarks: `permissions: contents: read` - release: `permissions: contents: write`, the only scope that `orbit-cli release publish` needs (push tags, create releases) - pin every `uses:` in .github/, including the setup-node and setup-python composites, to a full commit SHA with a version comment - `persist-credentials: false` on every checkout that does not push; release.yaml keeps it explicitly for `git push origin --tags` Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLiTf9UsrvvHjNxzpyjV45
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
No concrete defects were identified, but the pinned commits’ provenance and equivalence to previous references remain unverified.
No open issues 🎉
What changed in this PR
Hardens CI by limiting workflow token permissions and pinning external actions to commit SHAs.
Changes:
- Grants read-only contents access to CI and write access to releases.
- Pins external actions in workflows and shared setup actions.
- Disables persisted checkout credentials except for release publishing.
| File | Description |
|---|---|
.github/workflows/validation.yaml |
Restricts permissions, pins actions, and disables credential persistence. |
.github/workflows/tests.yaml |
Applies token, action-reference, and checkout hardening. |
.github/workflows/release.yaml |
Grants release write access and retains push credentials. |
.github/workflows/builds.yaml |
Hardens checkout and pins Docker setup. |
.github/workflows/benchmarks.yaml |
Restricts permissions and pins benchmark dependencies. |
.github/actions/setup-python/action.yaml |
Pins Python setup. |
.github/actions/setup-node/action.yml |
Pins Node.js, pnpm, and cache actions. |
Review effort: Balanced
sea-snake
approved these changes
Oct 19, 2026
aterga
marked this pull request as ready for review
October 19, 2026 16:44
aterga
enabled auto-merge (squash)
October 19, 2026 16:44
|
✅ No security or compliance issues detected. Reviewed everything up to 603c252. Security OverviewDetected Code Changes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardens the CI workflows' token scope and action references.
Changes
tests.yaml,validation.yaml,builds.yamlandbenchmarks.yamlnow declarepermissions: contents: readinstead of inheriting the repository default.release.yamldeclarescontents: write, the only scopeorbit-cli release publishneeds (push tags, create releases).uses:in.github/, including thesetup-nodeandsetup-pythoncomposite actions, is pinned to a full commit SHA with a version comment. Each SHA is what the previous tag/branch resolved to, so the code that runs is unchanged.dfinity/setup-dfxuses the same commit already pinned in.github/actions/deploy-backend.persist-credentials: falseon every checkout that does not push.release.yamlkeeps credentials explicitly because it runsgit push origin --tags.Notes
ghcalls; artifacts and caches use the runtime token, whichpermissions:does not affect.Generated by Claude Code