Skip to content
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

Fix tag normalization for Azure Pipelines #4400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChristopherMann
Copy link

@ChristopherMann ChristopherMann commented Jan 31, 2025

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 as
refs/tags/<tag>. When we do not ignore the tags in the Azure Pipelines agent, the repository normalization will normalize
the tag name refs/tags/<tag> to the local branch name tags/<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:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

?? Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH");
public override string? GetCurrentBranch(bool usingDynamicRepos)
{
var gitBranch = Environment.GetEnvironmentVariable("GIT_BRANCH");
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants