fix(release): set channel for release/* and hotfix/* branches#586
Merged
Conversation
semantic-release defaults nextRelease.channel to the matched branch name when no explicit channel is set. For a branch like release/UEPR-297-accessibility-improvements that put a '/' in the npm dist-tag, and npm publish rejected it with 404 Not Found. Apply the same prefix-stripping template that prerelease already used, via a small helper so the two fields can't drift.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the repo’s semantic-release configuration to ensure release/* and hotfix/* branches publish with a valid npm dist-tag (channel) by stripping the branch prefix, avoiding / characters that npm rejects.
Changes:
- Add an explicit
channeltemplate forrelease/*andhotfix/*branches to prevent npm dist-tag generation from including/. - Factor the shared “strip prefix from
${name}” logic into astripPrefixhelper and reuse it for bothchannelandprerelease.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
nextRelease.channelto the matched branch name when no explicitchannelis set. For a branch likerelease/UEPR-297-accessibility-improvementsthat put a/in the npm dist-tag passed tonpm publish --tag, and the registry rejected it with404 Not Found.channeltemplate to therelease/*andhotfix/*branch configs that mirrors the existingprereleasetemplate (strip therelease/orhotfix/prefix from${name}).stripPrefixhelper so the two fields can't drift.The published version (
13.8.0-UEPR-297-accessibility-improvements.1) was already correct because theprereleasetemplate was in place — only the channel needed fixing. This is the first time the publish workflow has been exercised from arelease/*branch, so the gap wasn't visible until now.The currently-blocked release branch will need this cherry-picked (or develop merged into it) before retrying its publish.
Test plan
release/UEPR-297-accessibility-improvements(after picking up this fix) and confirmnpm publishsucceeds with dist-tagUEPR-297-accessibility-improvements.npm install @scratch/scratch-svg-renderer@UEPR-297-accessibility-improvements.