Skip to content

Commit

Permalink
Create sync-generation-temp.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
VeryEarly authored May 29, 2024
1 parent 4046bf6 commit 44b6404
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/sync-generation-temp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: sync-generation
run-name: Sync commit from generation to future - temporary
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.html_url }}
on:
push:
branches:
- 'generation'
jobs:
process_labels:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: 'generation'
- uses: actions/setup-node@v4
with:
node-version: 14.17.1
- run: npm install -g autorest@latest
- name: sync generation
shell: pwsh
run: |
<#
login as bot
#>
$commitId = ${{ github.sha }}
$repoRoot = ${{ github.workspace }}
git fetch origin future
git checkout origin/future
git cherry-pick $commitId
git reset HEAD~1
<#
calculate changed modules
#>
$modulePaths = @()
git status --short | ForEach-Object { $modulePaths += $_.substring($_.IndexOf("src"), $_.IndexOf(".Autorest")+6) }
$modulePaths | Select-Object -Unique
foreach ($modulePath in $modulePaths) {
$modulePath = Join-Path $repoRoot $modulePath
Set-Location $modulePath
autorest --max-memory-size=8192
./build-module.ps1
}
Set-Location $repoRoot
git add src
git commit -m "cherry-pick $commitId from generation"
git push origin future

0 comments on commit 44b6404

Please sign in to comment.