-
Notifications
You must be signed in to change notification settings - Fork 63
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
v5.3.0 always looks for tags created from the branch #126
Comments
Yes, or more specifically it always looks at the current HEAD unless you set the branch explicitly (not recommended 99% of the time). So "current" is found using
If it looked at the entire repository you'd get some very strange behavior, especially when re-running older builds. |
Thanks for the reply. It's an awesome action. Will each branch start with 0.0.1? I assume no, as it could cause scmtag exists issue. How to support this case using this action? |
Thanks, yes, there is a new branch support feature just added a few weeks ago (#76). The term branches in this context can be a bit overloaded so let me define these first:
What the In this way you would be able to do things like merge a bug fix into multiple version branches without worrying about the tags present in the commit log for other versions or commit messages causing a conflict with another already published version. You should tag the commit where that branch is first created in order to get reliable increment numbers, otherwise the action won't know how far back a particular version branch forked from the main trunk, and continue to tag commits when you release them the same as you would without branch support enabled since the action will still look for tags matching the branch version. Note that in your example it seems that you are specifying the patch as part of the branch name, is the major version supposed to be 2023? If you enable |
The problem I am facing is when I create tags from feature branches. Same tags are getting created from both feature branches and my pipeline is failing with error SCM tag already exists. How do I get past this? Use case is to be able to create tags from different feature branches but follow semantic versioning for the repository |
Well the tags need to be unique, I'm not sure what you're using exactly though. What I mean is imagine you are on master and you are releasing a new version, say Some time goes by and you want to release an update. You're still on branch After you've released Using branches for versioning is quite an advance use case, most people will not need. I am in the process of writing up a guide which includes a section on choosing a versioning strategy. It is still a work in progress, but might be helpful. |
Hi, I actually have the same question, but I'm not quite understand your explanation above.
This command will only list the tags reachable from Could you also elaborate on this, please?
Why would we have strange behaviour? My use case is: feature branches will be created, and once a feature is done, the feature branch will be merged back to the main branch, producing a release. There is only one series of version numbers. |
Well yes. Maybe I can add some detection for this and print a friendly warning or something.
You'd randomly pick up versions jumping ahead depending on how other branches had been tagged, the latest version would always be selected. This commit is quite likely not even an ancestor of the current HEAD, so how do we get the commits between them? If you went back and reran a previous build, you'd be trying to use a different tag as the previous tag, etc. Based on the use case you described you do not need to use the version from branch feature at all, this is an advanced feature intended only for maintaining ongoing updates to previous versions. One thing you may wish to do is to use the branch name or commit hash as part of the version (e.g. e.g. env:
VERSION: ${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}-${{ github.head_ref }}+${{steps.version.outputs.increment}} This will prevent version conflicts if you have two branches running at the same time which have the same number of commits since the last version tag, which may or may not be a problem for you depending on what else you are doing. I am going to change this to a conversation, if there's a bug or feature request please open a new issue for it. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
v5.3.0 always looks for tags created from the branch.
By default it should consider last matching tag on the repo. Right now it's always making an increment to tag from the particular branch.
Is this expected behaviour?
The text was updated successfully, but these errors were encountered: