ci: declare read-only GitHub token permissions for workflows - #265
Merged
karagozemin merged 1 commit intoAug 30, 2026
Merged
Conversation
Closes Sub-Rosa-Issue#249 Los cuatro workflows heredaban los permisos por defecto del repositorio en vez de declarar el minimo que usan. Ahora los cuatro declaran `contents: read` a nivel workflow. Verificado antes de tocar nada: ninguno de los cuatro hace push, comenta, publica releases ni referencia GITHUB_TOKEN o secrets. Las unicas acciones que usan son checkout, setup-node, pnpm/action-setup, rust-toolchain y rust-cache, todas de solo lectura. Asi que bajar el permiso no le saca nada a ningun job. Sin cambios de triggers, de jobs, de versiones de acciones ni de comandos. Los cuatro YAML siguen parseando. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Closes #249
Every workflow now declares
contents: readat workflow level. Nothing else changed.What was there before
None of the four workflows declared a
permissionsblock, so all four inherited the repository default, which is broader than what these jobs use:bindings-check.ymlcontents: readcontract.ymlcontents: readcoverage.ymlcontents: readdocs-links.ymlcontents: readWhy
contents: readis enoughI checked this before lowering anything, since a workflow that actually writes would break on its next run rather than at merge time. Across all four workflows there is:
git push, nogh pr/gh issue/gh releaseGITHUB_TOKENand nosecrets.*The complete set of actions used is
actions/checkout@v4,actions/setup-node@v4,pnpm/action-setup@v4,dtolnay/rust-toolchain@stableandSwatinem/rust-cache@v2. All read-only.Placement and validation
The block goes after the
on:section and before the next top-level key, so it reads where a reviewer expects it.All four parse after the change, with triggers and jobs unchanged:
One thing worth knowing for later
This makes the workflow-level grant explicit, so any future job that needs to write (commenting on a PR, pushing bindings, publishing) will have to declare its own job-level
permissions. That is the intended trade: it fails loudly at the job that needs it instead of quietly having write access everywhere.No action versions, triggers, job names or commands were touched.
🤖 Generated with Claude Code