Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .azure-pipelines/refresh-autorest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ parameters:
- name: scope
displayName: Select target Autorest modules
type: string
default: autorest-all
default: autorest-selected
values:
- autorest-all
- autorest-selected
- autorest-v3-only
- autorest-v4-only
- autorest-selected
- autorest-all

- name: selectedServices
displayName: Input service names you want to refresh separated by semi-colon (;). Wildcard match is supported.
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
script: |
$autorestPaths = @()
$autorestModules = Get-ChildItem -Filter "*.Autorest" -Directory -Recurse | Select-Object -ExpandProperty FullName
if ("${{ parameters.scope }}" -eq "autorest-v3-v4") {
if ("${{ parameters.scope }}" -eq "autorest-all") {
$autorestPaths = $autorestModules
}
elseif ("${{ parameters.scope }}" -eq "autorest-selected") {
Expand Down Expand Up @@ -144,9 +144,10 @@ jobs:
Write-Host "##[endgroup]"
Write-Host
}
$buildId = $(Build.BuildId)

Set-Location ..
git checkout -b 'codegen/${{ parameters.scope }}' 'origin/${{ parameters.targetBranch }}'
git checkout -b "codegen/${{ parameters.scope }}-$buildId" 'origin/${{ parameters.targetBranch }}'

- task: PowerShell@2
displayName: Migrate from generation to target branch
Expand Down Expand Up @@ -189,7 +190,8 @@ jobs:
targetType: inline
script: |
$sourceBranch = '$(Build.SourceBranch)'.Replace("refs/heads/", "")
$headBranch = 'codegen/${{ parameters.scope }}'
$buildId = $(Build.BuildId)
$headBranch = "codegen/${{ parameters.scope }}-$buildId"
$baseBranch = '${{ parameters.targetBranch }}'
git config user.email "[email protected]"
git config user.name "azure-powershell-bot"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- name: process label
shell: pwsh
run: .github/workflows/script/PrLabeled.ps1 -LabelName "${{ github.event.label.name }}" -PrUrl $env:PR
run: .github/workflows/script/PrLabeled.ps1 -LabelName "${{ github.event.label.name }}" -PrUrl $env:PR