Skip to content

Commit

Permalink
Fix calculating the branch name if BRANCH_NAME isn't set. (#21115)
Browse files Browse the repository at this point in the history
BRANCH_NAME is the variable Jenkins used, so add support for the
variable Azure DevOps uses (BUILD_SOURCEBRANCH).

Backport of #21114

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
  • Loading branch information
1 parent 0679876 commit d304945
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ PACKAGE_HEAD_REV=$(shell git rev-parse HEAD)
# This is done in Make.versions, not here.
#

ifeq ($(BRANCH_NAME),)
ifneq ($(BUILD_SOURCEBRANCH),)
# BUILD_SOURCEBRANCH is set in Azure DevOps, so use that value if it exists
# it seems to always start with refs/heads/, so strip off that first.
CURRENT_BRANCH:=$(subst refs/heads,,${BUILD_SOURCEBRANCH})
else ifeq ($(BRANCH_NAME),)
# BRANCH_NAME is set in Jenkins, so this is for local builds.
CURRENT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)
else
Expand Down

7 comments on commit d304945

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.