Skip to content

Commit c8dd23a

Browse files
authored
Add buildId to the branch name (#24680)
* Add timestamp for new branch * Add timestamp for new branch * Add buildId for new branch
1 parent b4c064f commit c8dd23a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.azure-pipelines/refresh-autorest.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ jobs:
144144
Write-Host "##[endgroup]"
145145
Write-Host
146146
}
147+
$buildId = $(Build.BuildId)
147148
148149
Set-Location ..
149-
git checkout -b 'codegen/${{ parameters.scope }}' 'origin/${{ parameters.targetBranch }}'
150+
git checkout -b "codegen/${{ parameters.scope }}-$buildId" 'origin/${{ parameters.targetBranch }}'
150151
151152
- task: PowerShell@2
152153
displayName: Migrate from generation to target branch
@@ -189,7 +190,8 @@ jobs:
189190
targetType: inline
190191
script: |
191192
$sourceBranch = '$(Build.SourceBranch)'.Replace("refs/heads/", "")
192-
$headBranch = 'codegen/${{ parameters.scope }}'
193+
$buildId = $(Build.BuildId)
194+
$headBranch = "codegen/${{ parameters.scope }}-$buildId"
193195
$baseBranch = '${{ parameters.targetBranch }}'
194196
git config user.email "[email protected]"
195197
git config user.name "azure-powershell-bot"

0 commit comments

Comments
 (0)