Skip to content

Commit

Permalink
Sync tools folder from main branch to generation branch (#24691)
Browse files Browse the repository at this point in the history
Co-authored-by: azurepowershell <azurepowershell@ms.com>
  • Loading branch information
azure-powershell-bot and azurepowershell authored Apr 22, 2024
1 parent 248fc7e commit 361a813
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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 "65331932+azure-powershell-bot@users.noreply.github.com"
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

0 comments on commit 361a813

Please sign in to comment.