Skip to content

ci: declare contents:read on create-releases and detect-breaking-changes#665

Open
arpitjain099 wants to merge 1 commit into
openai:mainfrom
arpitjain099:chore/release-and-breaking-changes-permissions
Open

ci: declare contents:read on create-releases and detect-breaking-changes#665
arpitjain099 wants to merge 1 commit into
openai:mainfrom
arpitjain099:chore/release-and-breaking-changes-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

Two workflows currently leave the workflow GITHUB_TOKEN scope implicit:

  • .github/workflows/create-releases.yml -- runs stainless-api/trigger-release-please@v1.4.0 with STAINLESS_API_KEY (external secret) and, when a release is created, curls pkg.go.dev/fetch/... to warm the Go module proxy. Neither path uses the workflow's GITHUB_TOKEN.
  • .github/workflows/detect-breaking-changes.yml -- runs scripts against the PR base SHA + HEAD to fail on breaking changes. No GitHub API write.

This patch pins both to permissions: contents: read at workflow scope, matching the per-job block in ci.yml (contents: read + id-token: write for trusted publishing).

With explicit scope:

  • the workflow token can't be widened by a future change to the repo default
  • the SLSA / OpenSSF Scorecard Token-Permissions check passes for both files
  • third-party action exposure (stainless-api/trigger-release-please, actions/setup-go, actions/checkout) is bounded to read

No behavioural change.

create-releases.yml runs stainless-api/trigger-release-please with
STAINLESS_API_KEY (external secret), then optionally curls pkg.go.dev's
proxy index. No GitHub API call uses the workflow GITHUB_TOKEN.

detect-breaking-changes.yml runs scripts against the PR diff/base; no
GitHub API write.

Style matches the per-job permissions block in ci.yml (contents:read +
id-token:write for trusted publishing).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
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