Skip to content

ci: add permissions: contents: read to ci#475

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

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

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Sets the minimum-required GITHUB_TOKEN scope on ci.yml:

  • Workflow-level permissions: -> contents: read
  • No changes to jobs, steps, runners, or triggers
  • YAML still parses (yaml.safe_load succeeds)

Rationale:

  • The CI job is read-only; nothing in it needs write access to the repo.
  • Without an explicit block, the run inherits whatever default the repository's actions settings happen to be set to. That default has drifted in the past, and forks-of-forks lose track of it.
  • the OpenSSF Scorecard Token-Permissions check flags missing per-workflow permissions as a finding.
  • After the tj-actions/changed-files supply-chain incident from March 2025, the cost-benefit on explicit minimum scopes is firmly on the side of declaring them.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@rafaelfranca rafaelfranca merged commit 4dd08c1 into rails:main May 26, 2026
10 of 18 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