Skip to content

ci: declare contents:read on draft-release workflow#3938

Open
arpitjain099 wants to merge 1 commit into
ruby:masterfrom
arpitjain099:chore/declare-workflow-perms
Open

ci: declare contents:read on draft-release workflow#3938
arpitjain099 wants to merge 1 commit into
ruby:masterfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown

Pins .github/workflows/draft-release.yml to permissions: contents: read at the workflow level. The job uses secrets.MATZBOT_AUTO_UPDATE_TOKEN for the commit step and for peter-evans/create-pull-request, so every operation that writes to the repository or opens a PR goes through that PAT and not GITHUB_TOKEN. The default token here is only used by the implicit actions/checkout calls (read on contents, read on the cross-org ruby/ruby clone).

Even though the writes are routed through a PAT, an explicit cap matters because of CVE-2025-30066 (the March 2025 tj-actions/changed-files compromise). A tampered third-party action exfiltrates GITHUB_TOKEN from workflow logs and the leaked token carries whatever scope was issued at the workflow level. Without an in-file declaration, that scope is whatever the org default is set to today, which can be broader than what this workflow actually needs. Pinning here makes the minimum enforceable, gives drift protection if the default ever widens, and registers with OpenSSF Scorecard's Token-Permissions check.

YAML validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 14, 2026 16:07
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.

1 participant