Skip to content

Commit

Permalink
Fixing branch name logic.
Browse files Browse the repository at this point in the history
* The existing logic didn't account for a branch name being "release/3.1.0"
* We leveraged the azure devops variable 'Build.SourceBranchName' which returned the "last path segment in the ref string".
  • Loading branch information
StephenBonikowsky committed Oct 23, 2019
1 parent 0f5cf6c commit bb026c2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions eng/UpdatePRService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ steps:
:branch
echo Set the repo branch to be what build.SourceBranchName is: %BUILD_SOURCEBRANCHNAME%
REM The following vso call sets a variable that is accessible further down in the PowerShell script to Sync the PR Service.
echo ##vso[task.setvariable variable=branchNameorPrId]origin/%BUILD_SOURCEBRANCHNAME%
IF '%BUILD_SOURCEBRANCHNAME%'=='master' (
echo ##vso[task.setvariable variable=branchNameorPrId]origin/%BUILD_SOURCEBRANCHNAME%
) ELSE (
echo ##vso[task.setvariable variable=branchNameorPrId]origin/release/%BUILD_SOURCEBRANCHNAME%
)
goto done
:done
Expand Down Expand Up @@ -74,7 +78,11 @@ steps:
echo "Operation mode has been set to: $_OPERATION"
echo "##vso[task.setvariable variable=operation]$_OPERATION"
echo "Set the repo branch to be what build.SourceBranchName is: $BUILD_SOURCEBRANCHNAME"
echo "##vso[task.setvariable variable=branchNameorPrId]origin/$BUILD_SOURCEBRANCHNAME"
if [[ $BUILD_SOURCEBRANCHNAME = master ]]; then
echo "##vso[task.setvariable variable=branchNameorPrId]origin/$BUILD_SOURCEBRANCHNAME"
else
echo "##vso[task.setvariable variable=branchNameorPrId]origin/release/$BUILD_SOURCEBRANCHNAME"
fi
fi
displayName: Set_Operation_PR_or_Branch_Unix
Expand Down

0 comments on commit bb026c2

Please sign in to comment.