Skip to content

[FEATURE]: Support GIT_BRANCH env var for Azure pipelines in 5.x #4662

@Ninho67

Description

@Ninho67

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.MsBuild

GitVersion version

5.x

Operating system

N/A

What are you seeing?

Currently, gitversion 5.12.0 does not support a multi-repo build on azure pipelines. It uses solely BUILD_SOURCEBRANCH to compute the stamped version.

What is expected?

We would like to override the branch name with GIT_BRANCH environment variable, just as it works in gitversion 6.x.

We don't want to upgrade to gitversion 6.x because it does not support Visual Studio (more exactly the .net framework version of msbuild) anymore.

Steps to Reproduce

Create a pipeline with multiple repositories to build, including one that uses gitversion 5.12.0 for versioning.
Build.

The output version is {major}.{minor}.{patch}-{pipeline's branch name}.x

with {major}.{minor}.{patch} the valid version.

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions