fix(tag-action): strip prefix from pre_tag before semver operation#356
Open
mashmalko wants to merge 1 commit intoanothrNick:masterfrom
Open
fix(tag-action): strip prefix from pre_tag before semver operation#356mashmalko wants to merge 1 commit intoanothrNick:masterfrom
mashmalko wants to merge 1 commit intoanothrNick:masterfrom
Conversation
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 of changes
Fix semver parsing error when bumping prerelease tags on feature branches with tag prefixes.
Problem:
When bumping an existing prerelease tag on feature branches, the script was passing
pre_tag(e.g.,"customprefix0.3.3-feature-super.1") directly tosemver -i prerelease, which failed because semver cannot parse version strings with non-standard prefixes like"customprefix".Solution:
Strip the tag prefix from
pre_tagbefore passing it to semver, matching the existing pattern used forcurrent_tag(lines 171-176). The prefix is then added back to the semver result, ensuring the final tag maintains the correct format.Changes:
pre_tag(lines 216-222), mirroring thecurrent_taghandlingcurrent_pre_tag(without prefix) instead ofpre_tag(with prefix)Example:
semver -i prerelease "customprefix0.3.3-feature-super.1" --preid "feature-super"❌ (fails)semver -i prerelease "0.3.3-feature-super.1" --preid "feature-super"✅ (works, then prefix added back)Breaking Changes
Do any of the included changes break current behaviour or configuration?
NO
This is a bug fix that maintains backward compatibility. The behavior for:
.0tag)How changes have been tested
tagPrefix: Handled correctly (no prefix stripping needed)pre_tag: Handled correctly (condition evaluates to false, goes to else branch)pre_tagwith prefix (correct, since$newalso has prefix)current_tagprefix stripping pattern (lines 171-176)List any unknowns
current_tagprefix stripping, ensuring consistency and reliability.