Files
loki/scripts/ci
da212284a4 ci: green PRs merge and deploy themselves (#165)
Nobody is in the merge loop. The owner does not review PRs, and background-job
agent sessions are barred from merging by hand — so a verified, ready change
had no way to reach main without a manual step that nobody wants to take.

Move the policy into the repo, where it is visible, revocable, and applies
uniformly to every PR: a non-draft PR with every check green and no hold label
gets squash-merged, then CI is dispatched on main so Deploy ships it.

Two design points that are load-bearing, ported from OrangeCat's live run:
- One PR per sweep, only onto a green main. A PR's checks prove it against the
  main it branched from, not against the other queued PRs — batching would put
  an untested combination on main.
- Explicit `gh workflow run ci.yml --ref main` after a merge. A push made with
  the default GITHUB_TOKEN does not trigger workflows, and Deploy chains off CI
  via workflow_run, so without it every automated merge lands and silently
  never deploys. ci.yml gains workflow_dispatch for exactly this.

Mergeability is polled rather than read once: GitHub computes it lazily and
invalidates it whenever the base moves, so the fast path always sees UNKNOWN
on its first look. Cancelled checks are re-run rather than read as failures —
ci.yml uses cancel-in-progress, so an unrelated push can strand a PR forever.

Hold work back with a draft PR or a hold label. Corollary, now documented in
CLAUDE.md: never open a non-draft PR you would not want deployed.

Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 19:16:41 +02:00
..