Skip to content

Close linked sub-issues automatically on PR merge (squash-safe) #368

Closed

Description

@arutsh

GitHub's "Closes #N" keyword is only evaluated against the final commit
message that lands on main. On a squash-merge repo, that's the squash
commit box GitHub pre-fills from the commit(s) in the PR — not the PR
description — so a "Closes #N" trailer in the PR body alone doesn't
reliably close anything.

Case in point: PR #367 (Issue #362) merged with "Closes #362" in the PR
body, but the squash commit title only had "(#362)" (a bare reference,
not a closing keyword). Issue #362 never closed; confirmed via GraphQL
that closingIssuesReferences was empty and willCloseTarget was false.

Add a GitHub Action on pull_request (types: [closed], if merged == true)
that parses Issue- out of head.ref (same pattern scripts/flow.py's
BRANCH_RE already uses) and closes that sub-issue directly via the API,
plus the parent issue when it was the last open sibling group (same
sibling-check logic already in scripts/flow.py's cmd_pr). This removes
the dependency on GitHub's commit-message keyword parsing entirely, in
line with the other enforced-not-documented mechanisms in CLAUDE.md.

Activity

  1. added a commit that references this issue on Sep 30, 2026
    0674851
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions