Skip to content
Closed
Prev Previous commit
Next Next commit
chore: harden shutdown staging matcher
  • Loading branch information
masarray committed Sep 15, 2026
commit 7f0f736389e8c3f58997c96dfb35391df0b2e4b6
39 changes: 39 additions & 0 deletions .github/workflows/fix-stage-graceful-shutdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Fix graceful shutdown staging matcher

on:
push:
branches:
- fix/studio-graceful-shutdown-p0

permissions:
contents: write

jobs:
fix:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: fix/studio-graceful-shutdown-p0
fetch-depth: 0
- name: Replace brittle main-window anchor with structural regex
shell: python
run: |
from pathlib import Path
p = Path('.github/workflows/stage-studio-graceful-shutdown-v2.yml')
text = p.read_text(encoding='utf-8')
old = " replace_once('apps/arstack_studio/src/main.cpp', anchor, coordinator)\n"
new = """ regex_once(\n 'apps/arstack_studio/src/main.cpp',\n r' PrimaryWindowCloseFilter primaryCloseFilter\\{&app\\};\\n if \\(mainWindow != nullptr\\) \\{\\n mainWindow->installEventFilter\\(&primaryCloseFilter\\);\\n \\}\\n(?:\\n)?',\n coordinator)\n"""
if text.count(old) != 1:
raise SystemExit(f'expected one main-window anchor call, got {text.count(old)}')
p.write_text(text.replace(old, new, 1), encoding='utf-8')
- name: Commit matcher hardening
shell: bash
run: |
set -euo pipefail
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add .github/workflows/stage-studio-graceful-shutdown-v2.yml
git commit -m 'chore: use structural matcher for shutdown coordinator staging'
git push origin HEAD:fix/studio-graceful-shutdown-p0
Loading