-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Not able to retrieve pre-existing tag version made before setting up semantic-release #2407
Comments
Is there a workaround for this? Perhaps by adding the git note manually? |
Yes, to temporarily work around this you can add notes manually: (see the doc here) # example
git notes --ref semantic-release add -f -m '{"channels":["beta"]}' v2.0.0-beta.1
git push --force origin refs/notes/semantic-release |
Thanks @Badisi Looks like there also needs to exist some tagged commits of a specific format
|
Found this in the documentation: |
@aleclarson, this is exactly the documentation I was referring to in the description of this issue. This doc is incomplete as SR will also look for a |
Current behavior
When using
semantic-release
for the first time on a project with existing git tags, those are not found and as a result the next version is not computed correctly.Issue
Let's say we have an existing git with nothing but some
pre-release
tags.According to the documentation:
But even with this, SR will compute the next version as :
v1.0.0-beta.1
(instead of v1.0.0-beta.4).Explanation
Looking at the code, there should be also a
git note
attached to eachtag
for this to work.When no
notes
are found,channels
will equals to[null]
and as such no git tag version will be found at all on the branch.get-tags.js#L22
get-last-release.js#L33
Solution
Update the documentation
A pull request for clarifying the documentation was made but yet to be approved (#2240).
Fix the issue
I'm not too familiar with this library's code but I think one of these two could solve the issue :
channels
in get-tags.js#L22 might be replaced by:channels
could be normalized later in normalize.js.What do you guys think ?
Environment
The text was updated successfully, but these errors were encountered: