Skip to content

fix(bump): auto-increment prerelease when tag already exists#258

Merged
TimothyJones merged 3 commits intoabsolute-version:masterfrom
SLASHLogin:master
Dec 1, 2025
Merged

fix(bump): auto-increment prerelease when tag already exists#258
TimothyJones merged 3 commits intoabsolute-version:masterfrom
SLASHLogin:master

Conversation

@SLASHLogin
Copy link
Copy Markdown
Contributor

  • When cutting a prerelease with --prerelease, we now check existing git tags (respecting tagPrefix) for the same base version and prerelease channel.
  • If a tag already exists (e.g., v1.4.3-xyz.0), we auto-increment to the next available (e.g., v1.4.3-xyz.1) before tagging.
  • Also supports unnamed prereleases (e.g., -0, -1), applying the same collision-avoidance.
  • Adds integration tests for both named and unnamed prereleases in package.json and gitTagFallback flows.

Fixes: #211

@SLASHLogin
Copy link
Copy Markdown
Contributor Author

@TimothyJones Sorry for pinging you, but could you get this reviewed? If this isn't meeting any of the requirements, I'm happy to fix it

@TimothyJones
Copy link
Copy Markdown
Member

Apologies, I thought I had done this one already, but clearly I hadn't. Thanks for the tag, much appreciated!

Code looks fine to me - can you add a note to the readme that explains this behaviour? Then I'll release asap.

Update readme explaining how --prerelease automatically increments
the numeric suffix when a tag already exists for the same base version
and prerelease channel.
@SLASHLogin
Copy link
Copy Markdown
Contributor Author

Sorry for taking so long on my side. Updated the README and signed previous commits

@TimothyJones TimothyJones merged commit 75d69a6 into absolute-version:master Dec 1, 2025
@TimothyJones
Copy link
Copy Markdown
Member

Thanks for this! Released as 12.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cutting prerelease versions does not check if a tag already exists

2 participants