Skip to content

Do not parse PR body to find issues to close#5046

Closed
takaram wants to merge 2 commits intophpstan:2.1.xfrom
takaram:close-issue-bot
Closed

Do not parse PR body to find issues to close#5046
takaram wants to merge 2 commits intophpstan:2.1.xfrom
takaram:close-issue-bot

Conversation

@takaram
Copy link
Copy Markdown
Contributor

@takaram takaram commented Feb 25, 2026

Extracting linked issues from PR body is very hard as there are variety of syntaxes to link an issue.
https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

Especially some PRs use phpstan/phpstan#<issue number> format instead of the issue URL.

We should use closingIssuesReferences instead.

Extracting linked issues from PR body is very hard as there are
variety of syntaxes to link an issue.
https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

We should use `closingIssuesReferences` instead.
Comment thread .github/workflows/close-issues-on-merge.yml Fixed
Comment thread .github/workflows/close-issues-on-merge.yml Fixed
Comment thread .github/workflows/close-issues-on-merge.yml Fixed
- Avoid `${{ ... }}` syntax inside `run:`
- Use mapfile command rather than `URL=( $(...) )`
@ondrejmirtes
Copy link
Copy Markdown
Member

I wouldn't be doing this if it wasn't necessary. I'm aware of closingIssuesReferences but it doesn't work when being merged on non-default branch. Even the API returns an empty array.

@takaram takaram deleted the close-issue-bot branch March 3, 2026 12:46
@takaram
Copy link
Copy Markdown
Contributor Author

takaram commented Mar 3, 2026

it doesn't work when being merged on non-default branch. Even the API returns an empty array.

Ah, I misunderstood. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants