Auto-close linked issues when external PRs are merged via bot

Open Beginner friendly
#557 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
github-actions
Domain
ci-cd

Research direction

Start by reading .github/workflows/pr-merge.yml and trace how the “Merge External PR” body is built from the original pull request. Verify the workflow preserves Fixes, Closes, and Resolves references, then confirm that a merge into main causes the referenced issue to close automatically.

Written by the indexing model from the issue text.

Description

bug CI

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.

Dominant language
Go
Stars
298
Forks
202
Avg merge
2d 18h
Merged PRs (30d)
28

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from urunc-dev/urunc

All issues in urunc-dev/urunc

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.