-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Release tags are created on pull requests despite having set a release_branch #150
Comments
github-tag-action/src/utils.ts Lines 52 to 54 in dbd80d2
My understanding of this function is that it is supposed to check for pull request events. This would only check for pulls though? Edit: Nevermind, might have misunderstood that as well. |
@mikael-andersson91 so did you manage to generate prerelease tags? I struggle with branches like |
@mathieudutour Mathie, thanks you very much for this wonderful aciton! |
Just don't run the action on PRs? |
If that is your solution the README of the repository is misleading on the functionality of the action. I can accept it not being intended to be used for that functionality, but then it shouldn't say this in the README regarding the release_branches argument: Edit: Edit 2: As noted in the issue, when running the action on pull requests tags are created with the next release tag, not a version tag with the commit hash postfix as noted in the README |
We only want to consider tagging the main branch and pull requests. In principle, this workflow should only be triggered by pushes to main (because this is configured by `on`), but this is an extra safeguard should that change. Recent versions of github-tag-action have slightly confusing behaviour around tagging PRs: mathieudutour/github-tag-action#150 Confusingly, as that issue mentions, there is an option that specifies release branches with a *supposed* behaviour: > **release_branches** (*optional*) - Comma separated list of branches > (JavaScript regular expression accepted) that will generate the release > tags. Other branches and pull-requests generate versions postfixed with > the commit hash and do not generate any repository tag. Examples: > `master` or `.*` or `release.*,hotfix.*,master`... (default: > `master,main`). However, when we tried upgrading to github-tag-action v6.1 before, it was tagging pull requests, I believe.
This is definitely an option, but requires a bit more struggle. It would be awesome not to tag on PR as mentioned in README |
Hi,
I am attempting to use this action as part of a workflow that is triggered both on push and pull_request events on for my main branch with the following inputs:
The issue here comes when I run the workflow on pull requests a release tag is always created, despite having specified main as my only release branch. My understanding of the input documentation copied below is that pull requests would generate a version number with the commit hash as a suffix and not generate a tag, while push on release branch would generate a release tag. Have I misunderstood something with the implementation here?
Example job triggering a release on pull request:
https://github.com/mikael-andersson91/try-tag-actions/actions/runs/3396811156/jobs/5648291822
And in-case viewing the workflow run isn't available for you, here's the log from a pull request run where a release tag was created:
The text was updated successfully, but these errors were encountered: