Repository navigation
ci(release): run publish and upload in a release environment and verify publish_tag - #149
Merged
Merged
Conversation
…fy publish_tag Run the jobs that use the signing, Maven Central and R2 credentials in the release environment, so those secrets can move out of org scope. Check out publish_tag as refs/tags/<tag>, and publish it only if its commit is on the release branch the run was dispatched from. Part of SEC-2514, SEC-2515. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g check Review follow-up. Reject revision syntax such as v1.2.3~1, which resolved to an untagged commit, and accept only the default branch or a branch named N.x, since *.x also matched feature/foo.x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workflow triggers on any *.x branch, so a 4.1.x hotfix branch has to pass this check too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mogita
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
publish(signing key, Maven Central credentials) andupload(R2 credentials) run in a newreleaseenvironment. Those secrets can then move out of org scope into that environment.publish_tagis checked out asrefs/tags/<tag>, so a value that names a branch or a SHA no longer checks anything out.publish_tagis exactly a tag (git show-ref --verify, so revision syntax such asv1.2.3~1is rejected); the run comes from the default branch or anN.xbranch; and the tag's commit is on that branch (git merge-base --is-ancestor). Before this, any tag could be published, including one pushed on a commit that was never reviewed.Why
Security audit findings CI-02 and CI-03. Part of SEC-2514 and SEC-2515. Nine long-lived org secrets reach this repository with no environment gate, so any workflow on any branch can read them. The publish job also checked out any
publish_tagit was given.Settings needed for this to take effect (in this order)
releaseenvironment: add required reviewers, and set deployment branches tomainand*.x. Protect*.xwith a branch ruleset first.releaseenvironment secrets:GPG_KEY_CONTENTS,SIGNING_KEY_ID,SIGNING_PASSWORD,OSSRH_USERNAME,OSSRH_PASSWORD,STREAM_REPO_ACCESS_KEY_ID,STREAM_REPO_SECRET_ACCESS_KEY,STREAM_REPO_BUCKET,STREAM_REPO_ENDPOINT. Org secret values can't be read back, so the values have to come from whoever owns these credentials.stream-sdk-javafrom repository access on those nine org secrets.refs/tags/[0-9]*(this repository's tags have nov). release-please creates them with this workflow'sGITHUB_TOKEN, so the ruleset must let GitHub Actions through.Behaviour change
publishand then one forupload, because GitHub checks reviewers per job. If that's too much,uploadcould use a second environment that has the branch rule but no reviewers.publish_taghas to be dispatched from itsN.xbranch.Not in this PR
Moving the R2 upload to OIDC, which the audit also recommends. It needs support in
GetStream/stream-build-conventions-android'spublish-to-stream-repoaction.Testing
actionlint1.7.12 withshellcheck0.11.0: no new findings.Notes
#146 changes the
setup-gradlestep in the same job. The changes don't overlap.🤖 Generated with Claude Code
Note
High Risk
Touches the release signing and artifact publish path; misconfiguration of the new environment or branch rules could block releases or leave secrets exposed until follow-up settings are applied.
Overview
Publish and upload jobs now target a dedicated
releaseGitHub Environment so signing, Maven Central, and R2 secrets can live only there instead of org/repo secrets readable from any workflow branch.Checkout for publishing uses
refs/tags/<tag>with full history, and a new Verify the tag is on this release branch step runs before Gradle: the workflow must be onmainor anN.xbranch,publish_tagmust be a real tag (not branch/SHA/revision syntax), and that tag’s commit must be an ancestor of the branch head—blocking publish of arbitrary or unreviewed tags viaworkflow_dispatch.Reviewed by Cursor Bugbot for commit c3b5e8c. Bugbot is set up for automated code reviews on this repo. Configure here.