Skip to content

fix(ci): wire sc-governed-write-auth for security gate bypass - #106

Open
jacob-cloudy wants to merge 5 commits into
masterfrom
security-gate/wire-bypass-release
Open

fix(ci): wire sc-governed-write-auth for security gate bypass#106
jacob-cloudy wants to merge 5 commits into
masterfrom
security-gate/wire-bypass-release

Conversation

@jacob-cloudy

@jacob-cloudy jacob-cloudy commented Aug 3, 2026

Copy link
Copy Markdown

Context

The release workflow runs semantic-release after CI passes. @semantic-release/git pushes version-bump commits directly to master; once the org security gate is enabled, that push must authenticate as sc-governed-write[bot].

Problem

The initial wiring replaced CI_TOKEN entirely with the governed-write token. sc-governed-write only has contents: write, but @semantic-release/github also needs issues: write for failure reporting and issue/PR comments.

Solution

Use both tokens with separate roles (eng-doc Pattern B):

  • sc-governed-write-auth configures git credentials immediately before release, so @semantic-release/git's push to master bypasses the security gate.
  • CI_TOKEN stays as GH_TOKEN for @semantic-release/github (GitHub Releases, issue comments, failure issues).

Adds contents: write and packages: read permissions required by the composite action.

Related PRs

  • soundcloud/security-tooling PR to enroll intervene in the security gate rollout and allowlist this workflow (must merge second, after ProdSec review).

ProdSec setup (after security-tooling PR merges)

  1. Install sc-governed-write GitHub App on this repo.
  2. Grant this repo access to the SC_GOVERNED_WRITE_APP_PRIVATE_KEY org secret.

Follow-ups

  • Add sc-governed-write to the repo branch protection / ruleset bypass list (see PR comments).
  • Consider migrating legacy branch protection to a repo ruleset per eng-doc.

semantic-release pushes version-bump commits directly to master;
authenticate as sc-governed-write so the push is allowed once the
org security gate is enabled on this repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jacob-cloudy
jacob-cloudy requested a review from a team August 3, 2026 14:56
Comment thread .github/workflows/release.yml Outdated
Comment on lines +33 to +42
GH_TOKEN: ${{ secrets.CI_TOKEN }}
GH_TOKEN: ${{ steps.sc-governed-write.outputs.token }}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something we need to check is that the sc-governed-write token has the necessary permissions. Could someone please confirm?

Image

Comment thread .github/workflows/release.yml Outdated
Comment on lines +33 to +42
GH_TOKEN: ${{ secrets.CI_TOKEN }}
GH_TOKEN: ${{ steps.sc-governed-write.outputs.token }}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added sc-goverened-write to this repo's branch protection rule's bypass list. However, it would be preferable to migrate this rule to a ruleset (GH's new preferred way of protecting branches).

jacob-cloudy and others added 3 commits August 19, 2026 09:59
sc-governed-write-auth configures git credentials for the default-branch
push only. CI_TOKEN remains GH_TOKEN so @semantic-release/github can
create releases, comment on issues/PRs, and open failure issues.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use the composite action branch ref instead of a commit SHA so callers
pick up security-tooling updates without manual bumps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Split semantic-release into prep (CI_TOKEN for npm OIDC and analysis),
governed git push, and GitHub release creation so sc-governed-write-auth
only configures credentials for the master push.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant