Description
When an external PR includes closing keywords (e.g. Fixes #N), the referenced issue is not automatically closed after merge.
This happens because external PRs are first merged into an intermediate branch (main-pr<N>) instead of main. GitHub only auto-closes issues when changes are merged into the default branch.
See: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#about-linked-issues-and-pull-requests
The "Merge External PR" created by the pr-merge.yml workflow merges the intermediate branch into main, but it does not preserve the closing keywords from the original PR body.
Example
PR #545 includes Fixes #207, but after it is merged, issue #207 remains open.
Proposed solution
Update .github/workflows/pr-merge.yml to extract closing keywords (Fixes, Closes, Resolves) from the original PR body and include them in the merge PR body.
Since the merge PR targets main, GitHub should process these keywords and automatically close the referenced issues.
Description
When an external PR includes closing keywords (e.g.
Fixes #N), the referenced issue is not automatically closed after merge.This happens because external PRs are first merged into an intermediate branch (
main-pr<N>) instead ofmain. GitHub only auto-closes issues when changes are merged into the default branch.See: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#about-linked-issues-and-pull-requests
The "Merge External PR" created by the
pr-merge.ymlworkflow merges the intermediate branch intomain, but it does not preserve the closing keywords from the original PR body.Example
PR #545 includes
Fixes #207, but after it is merged, issue #207 remains open.Proposed solution
Update
.github/workflows/pr-merge.ymlto extract closing keywords (Fixes,Closes,Resolves) from the original PR body and include them in the merge PR body.Since the merge PR targets
main, GitHub should process these keywords and automatically close the referenced issues.