Skip to content

Commit 81a480e

Browse files
committed
Fix variable reference for source branch in setup-build-name.yml
1 parent dfa5be4 commit 81a480e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

azure/templates/setup-build-name.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ parameters:
55

66
steps:
77
- bash: |
8-
if [ -n "$(System.PullRequest.SourceBranch)" ]; then
9-
export SOURCE_BRANCH="$(System.PullRequest.SourceBranch)"
8+
if [ -n "$system_pull_request_source_branch" ]; then
9+
export SOURCE_BRANCH="$system_pull_request_source_branch"
1010
else
1111
export SOURCE_BRANCH=`echo $(SERVICE_ARTIFACT_NAME) | cut -d'+' -f1 | sed -e "s/$service_name-//"`
1212
fi
1313
echo "##vso[task.setvariable variable=BRANCH_NAME]`echo $SOURCE_BRANCH | sed -r 's/[/|\\@":<>?*]+/-/g'`"
1414
env:
1515
service_name: ${{ parameters.service_name }}
16+
system_pull_request_source_branch: $(System.PullRequest.SourceBranch)
1617
displayName: Set and replace invalid characters in branch name
1718
1819
- bash: 'echo "##vso[build.updatebuildnumber]$service_name-$(BRANCH_NAME)+$(Build.BuildID)"'

0 commit comments

Comments
 (0)