@@ -116,8 +116,9 @@ jobs:
116
116
}
117
117
$filesChanged | Select-Object -Unique | Out-File $filesChangedOutputPath
118
118
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)"
121
122
if ("$(Build.reason)" -in @('IndividualCI', 'BatchedCI')) {
122
123
$trigger = "$(Build.SourceVersion)"
123
124
$tmpBranchName += "/$(Build.SourceVersion)"
@@ -134,7 +135,7 @@ jobs:
134
135
}
135
136
}
136
137
Write-Host "`n##[group]Switch from $baseBranchName to $tmpBranchName"
137
- git fetch origin $(Build.SourceBranchName)
138
+ git fetch origin $sourceBranchName
138
139
git checkout -b $tmpBranchName $baseBranchName
139
140
140
141
Write-Host "`n##[group]build steps"
@@ -158,7 +159,7 @@ jobs:
158
159
git commit -m $prTitle
159
160
git push origin $tmpBranchName --force
160
161
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
162
163
163
164
<#
164
165
this commidId will be useful when we push directly to target branch in the future
0 commit comments