ci: Adjust stage-determine-changes.yml
This commit is contained in:
Родитель
aab5b0d108
Коммит
433aee6ef9
|
@ -6,11 +6,10 @@ jobs:
|
|||
steps:
|
||||
- powershell: |
|
||||
# Determine the context of the build (PR or push) and set the target branch accordingly
|
||||
$prTargetBranch = "$(System.PullRequest.TargetBranch)"
|
||||
$isPR = -not [string]::IsNullOrWhiteSpace($prTargetBranch)
|
||||
$isPR = "$(Build.Reason)" -eq "PullRequest"
|
||||
|
||||
# Normalize the target branch name for PR builds or default to 'master' for push builds
|
||||
$targetBranchName = $isPR ? $prTargetBranch -replace 'refs/heads/', '' : "master"
|
||||
$targetBranchName = $isPR ? "$(System.PullRequest.TargetBranch)" -replace 'refs/heads/', '' : "master"
|
||||
Write-Host "Build context determined: $(if ($isPR) { 'Pull Request targeting ' + $targetBranchName } else { 'Push' })"
|
||||
|
||||
# Fetch the target or default base branch and determine the merge base
|
||||
|
|
Загрузка…
Ссылка в новой задаче