Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync tools code from main branch to generation branch #24691

Merged
merged 1 commit into from
Apr 22, 2024
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 "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