fix(ci): correct DIST_BRANCH on release events for stream-dist deploy#1894
Merged
Conversation
On a release event, GITHUB_REF is refs/tags/<tag>, so the previous
${GITHUB_REF#refs/heads/} stripping left DIST_BRANCH equal to the literal
'refs/tags/<tag>'. The downstream 'git checkout -B "$DIST_BRANCH"' then
created a branch literally named 'refs/tags/<tag>' alongside the new tag
of the same short name, making 'git push --tags origin refs/tags/<tag>'
ambiguous:
error: src refspec refs/tags/<tag> matches more than one
Resolve by branching on github.event_name: derive DIST_BRANCH from the
release's target_commitish (typically master) on release events, and from
refs/heads/ on push events. Also tighten the release push to explicitly
push just the target branch and the new tag instead of relying on
--tags, which would push every local tag.
This bug was latent from the September 2024 workflow rewrite and only
became observable after PR #1853 re-added the release trigger, since
v4.2.0-rc.1 was the first release event to exercise this code path.
Verified failure on:
- runs/26573649458 (v4.2.0)
- runs/26493589602 (v4.2.0-rc.1)
bartoszgadomski
approved these changes
May 28, 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.
Fixes the stream-dist deploy workflow failing on release events with:
Root cause
On a release event,
GITHUB_REFisrefs/tags/<tag>. The previous setup step did:The
refs/heads/prefix strip is a no-op for tag refs, soDIST_BRANCHended up as the literal stringrefs/tags/v4.2.0. The latergit checkout -B "$DIST_BRANCH"then created a branch literally namedrefs/tags/v4.2.0alongside the new tag of the same short name, makinggit push --tags origin refs/tags/v4.2.0ambiguous (matched both the branch and the tag).Fix
Branch on
github.event_nameto deriveDIST_BRANCHcorrectly:releaseevents: pull the branch fromgithub.event.release.target_commitish(typicallymaster) and the tag from the ref.pushevents: keep the previous behaviour, derive the branch fromrefs/heads/and skip tagging.Also tighten the release push to explicitly push just the target branch and the new tag instead of relying on
--tags, which would push every local tag the runner happens to have.Why this is a new failure
The
release:trigger on this workflow was re-added in #1853 (2026-04-02). v4.2.0-rc.1 was the first release event to actually exercise this code path. The bug itself dates back to the September 2024 workflow rewrite and was dormant until then.Verified failure runs
Follow-up
The
v4.2.0tag onxwp/stream-distis missing as a result of this failure and will need to be created manually (the dist branch itself was updated successfully by the priorpush-to-masterrun, so only the tag is missing).Checklist
contributing.md). (N/A: cannot exercise release-event workflow locally; will validate on next release.)