Skip to content

ci: declare contents:read on detect-breaking-changes workflow#666

Closed
arpitjain099 wants to merge 1 commit into
openai:mainfrom
arpitjain099:chore/detect-breaking-changes-permissions
Closed

ci: declare contents:read on detect-breaking-changes workflow#666
arpitjain099 wants to merge 1 commit into
openai:mainfrom
arpitjain099:chore/detect-breaking-changes-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

The detect_breaking_changes job currently inherits the repo default token scope. It only runs actions/checkout (with fetch-depth: commits + 1 so it can reach the PR base), actions/setup-go, and ./scripts/detect-breaking-changes against the base SHA. No GitHub API write, no comment-on-PR, no registry push.

Worth declaring even if the repo-default is already read: the in-file block survives any future change to the Settings > Actions > General token-permissions toggle, and the OpenSSF Scorecard Token-Permissions check counts only per-workflow declarations (the implicit default doesn't move the score).

The defense-in-depth motivation is the CVE-2025-30066 shape: a compromised third-party action (actions/setup-go in this case) runs inside the existing job context and exfiltrates the GITHUB_TOKEN via build logs. The blast radius equals the token's scope at issue time; pinning the workflow to contents: read bounds it independent of what a YAML author with repo-write access could have done (that's a different attack vector).

Style matches the per-job permission block already declared in ci.yml (contents: read + id-token: write for the stainless-sdks variant). create-releases.yml is intentionally left out of this PR because the stainless-api/trigger-release-please step there needs broader scope.

The detect_breaking_changes job only checks out the PR head with
enough depth to reach the PR base, sets up Go, and runs
./scripts/detect-breaking-changes against the base SHA. No GitHub
API write, no cache. contents:read is the floor.

Matches the per-job permissions block already in ci.yml
(contents:read + id-token:write for the stainless-sdks variant).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 14, 2026 06:24
@arpitjain099
Copy link
Copy Markdown
Author

Sorry, duplicate of #665 which I opened earlier today and forgot about. Closing.

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