From 0196f74a2d075f9973a7e2cdc81736e451afa5ec Mon Sep 17 00:00:00 2001 From: AlterEgo Date: Sun, 5 Jul 2026 16:53:43 -0500 Subject: [PATCH] CI: Add pending SQL promotion workflow --- .github/workflows/promote-pending-sql.yml | 49 +++++++++++++++++++++++ sql/pending_updates/README.md | 5 ++- 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/promote-pending-sql.yml diff --git a/.github/workflows/promote-pending-sql.yml b/.github/workflows/promote-pending-sql.yml new file mode 100644 index 0000000000..5bbfbac1ba --- /dev/null +++ b/.github/workflows/promote-pending-sql.yml @@ -0,0 +1,49 @@ +name: promote-pending-sql + +on: + workflow_dispatch: + push: + paths: + - 'sql/pending_updates/*.sql' + - 'sql/pending_updates/**/*.sql' + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + promote: + if: github.actor != 'github-actions[bot]' + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.ref_name }} + + - name: Promote pending SQL updates + shell: pwsh + run: ./tools/dev/promote_pending_updates.ps1 -Apply + + - name: Commit promoted SQL updates + shell: pwsh + run: | + git add -A sql/pending_updates sql/updates + + $changes = git status --porcelain + $status = $changes -join "`n" + Write-Host $status + + if ([string]::IsNullOrWhiteSpace($status)) { + Write-Host "No promoted SQL changes to commit." + exit 0 + } + + 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 }} diff --git a/sql/pending_updates/README.md b/sql/pending_updates/README.md index 5da896da7b..5c0e617388 100644 --- a/sql/pending_updates/README.md +++ b/sql/pending_updates/README.md @@ -19,7 +19,8 @@ database setup and update tracking system can apply it. 1. Add the test SQL file to the matching pending folder. 2. Apply it manually to a test database. 3. Verify server startup, affected commands, and any in-game behavior. -4. Rename or adjust the file for the mainstream update sequence. -5. Move the verified file into `sql/updates/`. +4. Name the file like `YYYY-MM-DD__00_description.sql`. +5. Push the pending SQL file and let the promotion workflow move it into + `sql/updates/`. 6. Let the database setup system record it through `skyfire_db_updates` and `db_update`.