Skip to content

Commit 361a813

Browse files
azure-powershell-botazurepowershell
andauthored
Sync tools folder from main branch to generation branch (#24691)
Co-authored-by: azurepowershell <[email protected]>
1 parent 248fc7e commit 361a813

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.azure-pipelines/refresh-autorest.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ parameters:
77
- name: scope
88
displayName: Select target Autorest modules
99
type: string
10-
default: autorest-all
10+
default: autorest-selected
1111
values:
12-
- autorest-all
12+
- autorest-selected
1313
- autorest-v3-only
1414
- autorest-v4-only
15-
- autorest-selected
15+
- autorest-all
1616

1717
- name: selectedServices
1818
displayName: Input service names you want to refresh separated by semi-colon (;). Wildcard match is supported.
@@ -55,7 +55,7 @@ jobs:
5555
script: |
5656
$autorestPaths = @()
5757
$autorestModules = Get-ChildItem -Filter "*.Autorest" -Directory -Recurse | Select-Object -ExpandProperty FullName
58-
if ("${{ parameters.scope }}" -eq "autorest-v3-v4") {
58+
if ("${{ parameters.scope }}" -eq "autorest-all") {
5959
$autorestPaths = $autorestModules
6060
}
6161
elseif ("${{ parameters.scope }}" -eq "autorest-selected") {
@@ -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"

.github/workflows/pr-labeled.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
pull-requests: write
1515
contents: read
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
with:
1919
sparse-checkout: |
2020
.github
2121
- name: process label
2222
shell: pwsh
23-
run: .github/workflows/script/PrLabeled.ps1 -LabelName "${{ github.event.label.name }}" -PrUrl $env:PR
23+
run: .github/workflows/script/PrLabeled.ps1 -LabelName "${{ github.event.label.name }}" -PrUrl $env:PR

0 commit comments

Comments
 (0)