Skip to content

ci: scope workflow token to read-only#148

Merged
rafaelfranca merged 1 commit into
rails:masterfrom
arpitjain099:chore/restrict-workflow-token-perms
May 28, 2026
Merged

ci: scope workflow token to read-only#148
rafaelfranca merged 1 commit into
rails:masterfrom
arpitjain099:chore/restrict-workflow-token-perms

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

Adds permissions: contents: read to the CI workflow. The workflow checks out the repo, installs dependencies, and runs tests - none of which need write access to repository contents or other API scopes. Pinning the token to read-only follows the principle of least privilege and limits exposure in the event of a compromised dependency or action.

More details on token permissions: https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication

Restrict the GITHUB_TOKEN to contents: read since the CI
workflow only needs to check out source and run tests.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@rafaelfranca rafaelfranca merged commit 7cd751f into rails:master May 28, 2026
10 of 17 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