CI: Open PR for pending SQL promotion

This commit is contained in:
AlterEgo 2026-07-05 16:57:20 -05:00
parent 0196f74a2d
commit ea74f2bafb

View file

@ -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"