-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix tag normalization for Azure Pipelines #4400
Fix tag normalization for Azure Pipelines #4400
Conversation
?? Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH"); | ||
public override string? GetCurrentBranch(bool usingDynamicRepos) | ||
{ | ||
var gitBranch = Environment.GetEnvironmentVariable("GIT_BRANCH"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this variable come from? I can only find references that refer to Jenkins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an environment variable we've adopted in GitVersion as a way for the build environment to indicate which branch is being built. But as you can see from #3049, support for the variable is not fully implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any updates on this? It's annoying to have versions like 1.1.3-tags-1-1-1.1
created.
@Mergifyio rebase |
✅ Branch has been successfully rebased |
ac3e804
to
9925542
Compare
@asbjornu mind to check this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@Mergifyio rebase |
✅ Branch has been successfully rebased |
9925542
to
d587fce
Compare
Thank you @ChristopherMann for your contribution! |
Description
Change the Azure Pipelines agent so it does not return tag names as branch names.
Related Issue
#4015
Motivation and Context
Azure Pipelines provides the name of the tag for which the pipeline has been triggered in
BUILD_SOURCEBRANCH
asrefs/tags/<tag>
. When we do not ignore the tags in the Azure Pipelines agent, the repository normalization will normalizethe tag name
refs/tags/<tag>
to the local branch nametags/<tag>
. This leads to an incorrect calculation of prerelease labels(e.g.
tags-v1.2.3-beta.1
) .A similar issue has been fixed for GitHub Actions in #2838.
How Has This Been Tested?
Unit tests have been added for the Azure Pipelines agent.
Checklist: