From 2f774c5cf36546cbe8ea4ceedb4d8b25f90a9869 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 2 Nov 2026 03:39:40 +0700 Subject: [PATCH] Pitfall: merge the commit CI tested, not a head read later #141 was merged at a head two commits past its green CI run. --- docs/pitfalls.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/pitfalls.md b/docs/pitfalls.md index 220f1d39..321e6389 100644 --- a/docs/pitfalls.md +++ b/docs/pitfalls.md @@ -20,6 +20,11 @@ the `&&` chain stopped, but the next lines still ran, so #138 merged the claim c work's title. Run commit, push, create and merge as separate steps and read each result; run the hook with the project's toolchain (`RUSTUP_TOOLCHAIN=1.99.0 git commit …`). +**A merge of commits no check ran on.** A script waited for one CI run of a PR, then merged +whatever the PR's head was by then; its author had pushed two more commits meanwhile, so #141 +reached `main` with code neither CI nor review had seen. Merge with `--match-head-commit` set to +the commit the green run tested (`gh run view --json headSha`), never to a head read later. + **A squash commit names the wrong PR number.** The subject was written as "(#12)" before the PR existed; it became #11. Take the number from `gh pr create`'s output (`${URL##*/}`) and use it.