Merging linked PRs did not closes the associated issues

Hello,

For some reason, the repo I’m maintaining will not automatically closes issues that were linked with a PR. I made sure that the PRs are properly merged into our default branch but it still doesn’t happen.

Here’s the issue in our repo. Here is its content:


Bug

Merging a linked PR into the master branch does not close its corresponding issue. See #592 and confirm the PR is merged into master using this url (just Ctrl + F and search for raspberry ). Also a few others like #582 and #543.

How to replicate the bug

Make an issue and make a PR. Link those together and merge the PR into master . The Issue will probably not close.

Possible Fixes/Solutions

Not sure. Here’s what we’ve tried:

  • Linking the issue using the GitHub website
  • Linking the issue by using keywords and mentioning the issue number in the comments (new icon: Qt (original) #691)
  • Searching on GitHub Community (found no issues similar to this)

My next move will be making a thread about this on the Community website. Hopefully, we’ll get an answer there


Note:

  • For our workflow, we merge our PRs into a develop branch using squash merge. After a while, we then merge it into the master branch using a normal merge commit.

  • I’m not sure if it’s related. Some of the Issues (like this)will have icons that show the PR were merged:

Others (like this) don’t:

Both are issues that should have been closed automatically

How were those PRs linked with the issue? I’m not seeing any “Closes: #592” or similar in the description, and at least for the one merged PR that’s listed as linked I also looked at the commits in it and didn’t see any such tag either.

Hi,

From what I understand in this link, as long as “closes #issue_number” is in one of the PR comments, it should be linked. See also this.

The contributor made sure to have the keyword within the description and as a commit message as wel

I noticed the PRs for the issues you’ve linked were all merged into develop, which is not your default branch. That explains it. The PR must be merged into the default branch to close issues. :slightly_smiling_face:

2 Likes

It’s a bit annoying that GitHub won’t close the issue later when the commits eventually get merged into master.

Thank you for your response though

I assume that would work if you didn’t use squash merges. That way the commits with the “closes” tags would end up on master, which should close the issues, too.