Skip to content

Commit 191798a

Browse files
authored
fix branch name for ci pipeline (#27123)
1 parent 80d4f29 commit 191798a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.azure-pipelines/azure-powershell-ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ jobs:
116116
}
117117
$filesChanged | Select-Object -Unique | Out-File $filesChangedOutputPath
118118
119-
$baseBranchName = "origin/$(Build.SourceBranchName)"
120-
$tmpBranchName = "archive/$(Build.SourceBranchName)/$(Build.Reason)"
119+
$sourceBranchName = "$(Build.SourceBranch)".Replace("refs/heads/","")
120+
$baseBranchName = "origin/$sourceBranchName"
121+
$tmpBranchName = "archive/$sourceBranchName/$(Build.Reason)"
121122
if ("$(Build.reason)" -in @('IndividualCI', 'BatchedCI')) {
122123
$trigger = "$(Build.SourceVersion)"
123124
$tmpBranchName += "/$(Build.SourceVersion)"
@@ -134,7 +135,7 @@ jobs:
134135
}
135136
}
136137
Write-Host "`n##[group]Switch from $baseBranchName to $tmpBranchName"
137-
git fetch origin $(Build.SourceBranchName)
138+
git fetch origin $sourceBranchName
138139
git checkout -b $tmpBranchName $baseBranchName
139140
140141
Write-Host "`n##[group]build steps"
@@ -158,7 +159,7 @@ jobs:
158159
git commit -m $prTitle
159160
git push origin $tmpBranchName --force
160161
161-
& $prScriptPath -Title $prTitle -HeadBranch $tmpBranchName -BaseBranch "$(Build.SourceBranchName)" -BotAccessToken '$(GithubToken)' -Description $prDescription
162+
& $prScriptPath -Title $prTitle -HeadBranch $tmpBranchName -BaseBranch $sourceBranchName -BotAccessToken '$(GithubToken)' -Description $prDescription
162163
163164
<#
164165
this commidId will be useful when we push directly to target branch in the future

0 commit comments

Comments
 (0)