forked from conventional-changelog/standard-version
-
Notifications
You must be signed in to change notification settings - Fork 43
Cutting prerelease versions does not check if a tag already exists #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
I encountered this as well. The cause for this bug seems to be that |
jaakkotuosa
added a commit
to jaakkotuosa/commit-and-tag-version
that referenced
this issue
Mar 10, 2025
jaakkotuosa
added a commit
to jaakkotuosa/commit-and-tag-version
that referenced
this issue
Mar 10, 2025
jaakkotuosa
added a commit
to jaakkotuosa/commit-and-tag-version
that referenced
this issue
Mar 10, 2025
Thanks for the report and the investigation! A fix for this would be welcome (and looks like #213 is an improvement too) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cutting a new prerelease version using the
--prerelease
parameter with the same value can fail when tagging if the tag already exists; this can happen if two features are in prerelease at the same time and multiple versions of each are interleaved. I believe only the latest tag is checked (or maybe only the package.json version?)Current behavior
Git tag is not checked prior to creating it
Expected behavior
Git tag existence should probably be checked and the version incremented if it already exists
Environment
commit-and-tag-version
version(s): 12.5Possible Solution
I have solved this in my github workflow by running a dry-run first, parsing the version number from the output, and grepping it in the output of
git tag
; if it already exists, increment the final component of the version and try again. Then use the first version that isn't already tagged with--release-as
. Something similar can probably be done internally?Additional context
Roughly the following commands have been executed:
Output of last command:
✔ bumping version in package.json from 1.4.3-abc.0 to 1.4.3-xyz.0
✔ bumping version in package-lock.json from 1.4.3-abc.0 to 1.4.3-xyz.0
✔ outputting changes to CHANGELOG.md
✔ committing package-lock.json and package.json and CHANGELOG.md and all staged files
✔ tagging release v1.4.3-xyz.0
fatal: tag 'v1.4.3-xyz.0' already exists
Command failed: git tag -a v1.4.3-xyz.0 -m chore(release): 1.4.3-xyz.0
fatal: tag 'v1.4.3-xyz.0' already exists
The text was updated successfully, but these errors were encountered: