-
Notifications
You must be signed in to change notification settings - Fork 654
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
Do not return the tag as branch name for GitLab CI #4187
base: main
Are you sure you want to change the base?
Conversation
In case of a tag pipeline, return null as branch name instead of the tag
Hi there. What happens:
Would be good to have some integration tests to cover your scenario. |
f07f4e0
to
c2946bc
Compare
I think this should cover the Scenarios (label for main branches is "dev")... Unfortunately at the moment I don't think I'll have the time to find out how to create those automated tests and implement them. Tag branch master with v1.2.0"FullSemVer": "1.2.0" Create branch development from master"FullSemVer": "1.2.1-development.1+0" Commit on development"FullSemVer": "1.2.1-development.1+1" Tag branch development with v1.3.0"FullSemVer": "1.3.1-development.1+0" Merge branch development into masterFullSemVer": "1.3.1-dev.1" Commit on master"FullSemVer": "1.3.1-dev.2" Tag branch master with v1.3.1"FullSemVer": "1.3.1" Merge branch master into development"FullSemVer": "1.3.2-development.1+1" |
Is there a plan for merge this fix? |
@HHobeck do you think we should get this merged? |
Yes, I think it can be merged. |
I think it needs tests. I also think we should investigate whether we can implement the same solution for other CI environments as well. |
In case of a tag pipeline, return null as branch name instead of the tag
Description
For tag pipelines (triggered by tagging a commit), do not return CI_COMMIT_REF_NAME as the current branch because in this case it contains the new tag instead of a branch.
Related Issue
Fixes #4186
Motivation and Context
Bugfix
How Has This Been Tested?
Manually tested the following scenarios on GitLab CI:
Also ran the tests in the solution.
Checklist: