fix(ci): override GITHUB_REF for beta + remove @semantic-release/git#1142
Open
fix(ci): override GITHUB_REF for beta + remove @semantic-release/git#1142
Conversation
Remove the @semantic-release/git plugin which pushes version bump commits and CHANGELOG.md back to the branch. The default github.token cannot push to protected branches, and this avoids the need for a PAT. Version source of truth is git tags + npm registry. Add a sync-versions devbox command to pull latest npm versions into package.json on demand. Update release docs accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
semantic-release uses env-ci which reads GITHUB_REF to determine the current branch. Since workflow_dispatch runs from master, GITHUB_REF is refs/heads/master even after git checkout -B beta. This caused beta releases to publish as stable versions instead of prereleases. Override GITHUB_REF=refs/heads/beta in the beta release step so semantic-release correctly detects the beta branch and publishes prerelease versions with the @beta dist-tag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Fix beta branch detection:
GITHUB_REF=refs/heads/betain the beta release stepenv-ciwhich readsGITHUB_REFto detect the branch. Sinceworkflow_dispatchruns from master,GITHUB_REFwasrefs/heads/mastereven aftergit checkout -B beta, causing beta releases to publish as stable versions instead of prereleasesRemove @semantic-release/git:
sync-versionsdevbox command to pull npm versions into package.json on demandDamage from previous beta run
Two packages were accidentally published as stable (not beta) before the crash:
@segment/analytics-react-native@2.22.0(published to@latest)@segment/analytics-react-native-plugin-amplitude-session@0.4.2(published to@latest)These may need to be addressed separately (deprecate, or accept as stable releases).
Test plan
-beta.Xsuffix and@betadist-tag🤖 Generated with Claude Code