Skip to content

Commit fdb4aa2

Browse files
committed
Fix target branch assignment logic in pipeline script for pull requests
1 parent 20ce595 commit fdb4aa2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ stages:
9292
targetType: 'inline'
9393
script: |
9494
# Set the target branch for comparison
95-
$targetBranch = "origin/$(System.PullRequest.TargetBranch)"
96-
if (-not $env:SYSTEM_PULLREQUEST_TARGETBRANCH) {
95+
if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH) {
96+
$targetBranch = "origin/$env:SYSTEM_PULLREQUEST_TARGETBRANCH"
97+
} else {
9798
$targetBranch = "origin/main"
9899
}
99100

0 commit comments

Comments
 (0)