Use gh pr merge --auto so the nightly bot waits for required checks - #1302
Use gh pr merge --auto so the nightly bot waits for required checks#1302escherize wants to merge 1 commit into
Conversation
With branch protection on master, an immediate merge fails while the Test Docs Build check is still pending. --auto queues the merge until required checks pass. Falls back to an immediate merge when auto-merge is unavailable (ie. before branch protection is enabled), so this is safe to land in either order.
|
Verification steps: Stage 1 — this PR: the "Test Docs Build" check on this PR proves the script still parses and the site builds. Stage 2 — after merge, before protection (fallback path): In the run's "Merge Updated Docs" step logs, expect Stage 3 — after enabling "Allow auto-merge" + the master ruleset (auto path): dispatch the same workflow. The logs should show no fallback message, the docs-update PR should show "Auto-merge enabled", and it should merge on its own once Test Docs Build passes: |
iethree
left a comment
There was a problem hiding this comment.
this is helpful, but we have a github actions native way to handle this. will submit another pr
Why
We want branch protection on master (see Slack discussion). The blocker is the nightly docs build: it opens its own PR and immediately merges it with
gh pr merge --squash, without waiting for checks. With a required "Test Docs Build" check, that immediate merge would fail every night.What
script/merge.cljnow triesgh pr merge --autofirst. With branch protection enabled, GitHub queues the merge and completes it once required checks pass. If--autoerrors (auto-merge unavailable — the current state, since master has no protection yet), it falls back to the old immediate merge.The fallback makes this safe to merge before protection is flipped on: behavior tonight is identical to today.
Rollout
After this merges, enabling protection is settings-only:
master: require PRs, require the "Test Docs Build" check, block force pushes, 0 required approvals (the bot can't approve its own PR).Validation
bb script/_test/all.clj, 38 assertions).