Repository navigation
fix(versionfile): keep hyphens in a prerelease suffix - #345
Merged
ValentinLutz merged 1 commit intoNov 2, 2026
Merged
Conversation
The version pattern stopped a prerelease suffix at the first hyphen. A marker with 1.2.3-rc-1 or a calver label such as 2026.11.1-public-beta became 1.2.4-1 or 2026.11.2-public-beta-beta. The suffix now accepts hyphens, as the build metadata already did.
Merged
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.
Split from #335 (commit 10).
What
yeet now replaces the full old version in an
x-yeet-versionmarker when the prerelease suffix has a hyphen.Before this fix, yeet stopped at the first hyphen in the suffix. It left the rest of the old suffix in the file:
VERSION = "1.2.3-rc-1"1.2.4VERSION = "1.2.4-1"VERSION = "1.2.4"VERSION = "1.2.3-rc.1"1.2.4VERSION = "1.2.4"VERSION = "1.2.4"Why
SemVer allows hyphens in a prerelease suffix. The pattern for build metadata already accepts hyphens. This change makes the prerelease pattern do the same.
Impact
main, only semver targets make prereleases.Tests
A new test in
internal/versionfile/generic_test.gocovers this case. The test fails without the fix.