Skip to content

ci: add permissions: contents: read to tests#924

Merged
rafaelfranca merged 1 commit into
rails:mainfrom
arpitjain099:chore/declare-workflow-perms
May 26, 2026
Merged

ci: add permissions: contents: read to tests#924
rafaelfranca merged 1 commit into
rails:mainfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

What: add permissions: contents: read to .github/workflows/tests.yml.

Why: the test workflow doesn't write to the repo. Declaring the minimum scope is what GitHub recommends (docs) and what OpenSSF Scorecard's Token-Permissions check expects.

Why now: tj-actions/changed-files (CVE-2025-30066) showed how cheap an explicit permissions: block is relative to the cost of a leaked write-scoped token.

Risk of this change: none observed locally. The token scope is being tightened, not loosened, so the only failure mode would be a step that secretly needed a write scope - which would have to be added back explicitly with a clear justification. YAML still parses (yaml.safe_load).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@rafaelfranca rafaelfranca merged commit 036cb4d into rails:main May 26, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants