diff --git a/.azure-pipelines/refresh-autorest.yml b/.azure-pipelines/refresh-autorest.yml index adbec6cafa98..39545097414b 100644 --- a/.azure-pipelines/refresh-autorest.yml +++ b/.azure-pipelines/refresh-autorest.yml @@ -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. @@ -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") { @@ -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 @@ -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 "65331932+azure-powershell-bot@users.noreply.github.com" git config user.name "azure-powershell-bot" diff --git a/.github/workflows/pr-labeled.yml b/.github/workflows/pr-labeled.yml index 1120d6e53875..3f2897769445 100644 --- a/.github/workflows/pr-labeled.yml +++ b/.github/workflows/pr-labeled.yml @@ -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 \ No newline at end of file + run: .github/workflows/script/PrLabeled.ps1 -LabelName "${{ github.event.label.name }}" -PrUrl $env:PR