Skip to content

Auto-close linked issues when a PR merges into a release branch #617

Description

@IBondarenko-iwg

Problem statement

GitHub's Closes #N auto-close fires only when a PR merges into the default branch. Since v4.1 development, PRs target releases/** (e.g. #615releases/4.1.0), so linked issues stay open after merge and must be closed by hand — #604 was the first hit. The Closes #N line that pr-link-check.yml requires in every PR body is currently a no-op for the whole release cycle, and milestone/board progress under-reports until someone notices.

Proposed outcome

When a PR merges into a releases/** branch, every issue referenced by closes|fixes|resolves #N in its body is closed automatically with state_reason: completed and an audit comment ("Closed via #PR (merged to releases/x.y.z)").

Implementation sketch: a small workflow, sibling of pr-link-check.yml — same pull_request_target + github-script pattern, no code checkout, and the same closes|fixes|resolves #N regex the link check already enforces. Trigger: pull_request_target: types: [closed] with branches: ['releases/**'], guarded by github.event.pull_request.merged == true. Note: the workflow must land on main to serve pull_request_target events.

Out of scope: issues linked only from commit messages; reopening on revert.

Affected users / use case

Everyone shipping PRs to release branches during a release cycle; maintainers tracking milestone progress (V4.1.0 resolves via releases/4.1.0).

Rough size

XS

Additional context, links, mockups

First occurrence: #604 merged via #615 into releases/4.1.0, stayed open, need to be closed manually. The same will hit #605#607 and every other release-branch PR this cycle. Prior art in-repo: .github/workflows/pr-link-check.yml (validates the Closes #N convention this proposal makes effective on release branches).

Metadata

Metadata

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions