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