Skip to content

Commit

Permalink
Merge pull request #1381 from unoplatform/dev/youssef/adjust-ci
Browse files Browse the repository at this point in the history
ci: Adjust stage-determine-changes.yml
  • Loading branch information
agneszitte authored Apr 8, 2024
2 parents aab5b0d + 433aee6 commit caac9ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build/stage-determine-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit caac9ed

Please sign in to comment.