mirror of
https://github.com/ProjectSkyfire/SkyFire_548
synced 2026-08-18 06:32:13 -04:00
CI: Open PR for pending SQL promotion
This commit is contained in:
parent
0196f74a2d
commit
ea74f2bafb
1 changed files with 27 additions and 2 deletions
29
.github/workflows/promote-pending-sql.yml
vendored
29
.github/workflows/promote-pending-sql.yml
vendored
|
|
@ -9,6 +9,7 @@ on:
|
|||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
|
@ -29,9 +30,14 @@ jobs:
|
|||
shell: pwsh
|
||||
run: ./tools/dev/promote_pending_updates.ps1 -Apply
|
||||
|
||||
- name: Commit promoted SQL updates
|
||||
- name: Open promoted SQL pull request
|
||||
shell: pwsh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
$branchName = "automation/promote-pending-sql-${{ github.run_id }}"
|
||||
|
||||
git switch -c $branchName
|
||||
git add -A sql/pending_updates sql/updates
|
||||
|
||||
$changes = git status --porcelain
|
||||
|
|
@ -46,4 +52,23 @@ jobs:
|
|||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git commit -m "SQL: Promote pending updates"
|
||||
git push origin HEAD:${{ github.ref_name }}
|
||||
git push origin HEAD:refs/heads/$branchName
|
||||
|
||||
$headers = @{
|
||||
Authorization = "Bearer $env:GITHUB_TOKEN"
|
||||
Accept = "application/vnd.github+json"
|
||||
"X-GitHub-Api-Version" = "2022-11-28"
|
||||
}
|
||||
$body = @{
|
||||
title = "SQL: Promote pending updates"
|
||||
head = $branchName
|
||||
base = "${{ github.ref_name }}"
|
||||
body = "Automated promotion from sql/pending_updates into sql/updates."
|
||||
} | ConvertTo-Json
|
||||
|
||||
Invoke-RestMethod `
|
||||
-Method Post `
|
||||
-Uri "https://api.github.com/repos/${{ github.repository }}/pulls" `
|
||||
-Headers $headers `
|
||||
-Body $body `
|
||||
-ContentType "application/json"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue