Skip to content

Commit 198839d

Browse files
committed
Try other variables to get the branch name for checkout
1 parent e81ae17 commit 198839d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pipelines/azure-test.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,17 @@ jobs:
8787
workingDirectory: $(Pipeline.Workspace)/s/assemblyline-ui
8888
- script: |
8989
# Try to checkout the matching branch, if the command fails, don't care.
90-
git checkout -b $(Build.SourceBranchName) -t origin/$(Build.SourceBranchName) || true
90+
export BRANCH_NAME=$(basename -- "$SYSTEM_PULLREQUEST_SOURCEBRANCH")
91+
export BRANCH_NAME=${BRANCH_NAME:-"$BUILD_SOURCEBRANCHNAME"}
92+
git checkout -b $BRANCH_NAME -t origin/$BRANCH_NAME || true
9193
sudo env "PATH=$PATH" python -m pip install --no-cache-dir -e .
9294
displayName: Install assemblyline
9395
workingDirectory: $(Pipeline.Workspace)/s/assemblyline-base
9496
- script: |
9597
# Try to checkout the matching branch, if the command fails, don't care.
96-
git checkout -b $(Build.SourceBranchName) -t origin/$(Build.SourceBranchName) || true
98+
export BRANCH_NAME=$(basename -- "$SYSTEM_PULLREQUEST_SOURCEBRANCH")
99+
export BRANCH_NAME=${BRANCH_NAME:-"$BUILD_SOURCEBRANCHNAME"}
100+
git checkout -b $BRANCH_NAME -t origin/$BRANCH_NAME || true
97101
sudo env "PATH=$PATH" python -m pip install --no-cache-dir -e .
98102
displayName: Install assemblyline-core
99103
workingDirectory: $(Pipeline.Workspace)/s/assemblyline-core

0 commit comments

Comments
 (0)