← ClaudeAtlas

gh-squash-merge-closes-only-one-issuelisted

GitHub auto-close on squash-merge only catches ONE issue per PR even when the PR title/body says "Closes #447, #448, #449, #450". The first issue closes; the rest stay OPEN. Use when: (1) you opened a PR with a title or body listing multiple "Closes #X, #Y, #Z" references, (2) the PR squash-merged successfully (`gh pr view N --json state` = MERGED), (3) `gh issue list --state open` shows some of the referenced issues are still OPEN. Root cause: GitHub's auto-close keyword parser binds one keyword to one issue; "Closes #447, #448" is interpreted as "Closes #447" plus an inline reference to #448. Fix: either (a) write one keyword per issue ("Closes #447. Closes #448. Closes #449.") in the PR body BEFORE merging, or (b) post-merge, run `gh issue close $N --comment "Closed by PR #M (squash-merge auto-close caught only one)"` for each leftover. Different from `pr-followup-commit-stranded-after-squash` (which covers stranded COMMITS, not stranded ISSUES). Saves a "why are my issues still open after merging the fix?
wan-huiyan/agent-traffic-control · ★ 1 · Code & Development · score 80
Install: claude install-skill wan-huiyan/agent-traffic-control
# GitHub squash-merge auto-closes only one issue per PR ## Problem You shipped a fix PR that addresses 4 filed issues. PR title: > `fix(dashboard): wire /actions cohort tiles + plug 4 audit P0s (closes #447, #448, #449, #450)` PR body opens with: > Closes #447, #448, #449, #450 — the four template/route P0s from the audit. PR squash-merges cleanly. CI green, branch deleted. You move on. Later: `gh issue list --state open` shows `#448`, `#449`, `#450` still OPEN. Only `#447` got auto-closed. You spend a confused minute checking whether the fix actually shipped (it did) before realising the issues never closed. ## Context / Trigger Conditions All of: 1. PR title or body includes a comma-separated `Closes #X, #Y, #Z` (or `Fixes`, `Resolves`) reference. 2. PR was **squash-merged** (regular merge has slightly different parsing but the same gotcha applies). 3. After merge: `gh pr view N --json state` returns `MERGED`, but `gh issue view #Y` returns `OPEN` for the second-and-later issues. 4. The first issue in the comma list IS closed correctly — proves your "Closes" keyword wasn't malformed. This is **not** about the issues' content / labels / state. The fix did ship. The auto-close parser just bound the keyword to one issue. ## Solution ### Path A — prevent (preferred, before merge) Write one keyword per issue in the PR body. GitHub closes each: ```markdown ## Summary Bundles four P0 fixes from the 2026-05-07 audit. Closes #447. Closes #448. Closes #449. Closes #4