Skip to content

Conversation

NalinDalal
Copy link

Resolves #7989

Changes:
Added a yaml file which listens for maintainers comments to close and merge pul request.

Screenshots of the change:
471219101-c65956ce-6281-4e45-9730-a11b24e1bd3b
471219111-f51df78a-ad11-44a1-909a-431ee173d2b7

reference
reference-website-repo

I was cleaning up my local git branch and accidentally deleted the branch I was using for testing, so the original pull request also got deleted.
Hence again opening the pull request.

PR Checklist

with:
script: |
const prBody = context.payload.pull_request.body;
const issueRegex = /(Fixes|Resolves|Closes)\s+#(\d+)/gi;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: consider making more flexible? Eg /(close[sd]?|fix(e[sd])?|resolve[sd]?)[:\s]*#(\d+)/gi or something like that to more match the level of flexibility that happens on the main branch. While this is a bit more complex, I think matching behavior between these branches might be worth doing, what do you thi nk @perminder-17 ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aah, yes, that sounds great to me and also very flexible as well. It would help ensure consistency with the main branch’s behavior.


jobs:
close_issues:
if: github.event.pull_request.merged == true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@ksen0
Copy link
Member

ksen0 commented Aug 27, 2025

Relates to #7975

@NalinDalal NalinDalal changed the title Solves Issue 7975 Auto-link / Close Issues for 2.0 PRs (p5.js & p5.js-website) Aug 27, 2025
@limzykenneth
Copy link
Member

I've put together https://github.com/processing/branch-pr-close-issue. If it looks good we can transition the inline script over to that action repo. The main difference would be in the regex, I'm not 100% sure what the matching behavior of GitHub's auto link feature is but I've limited it to a more restrictive set:

  • Resolves #42
  • Resolves: #42
  • Resolves#42
  • Resolves:#42
  • Resolves : #42
  • Resolves #42
  • Resolves::#42

Only the ticked ones above will match, the others are for illustrative purposes. The other keywords and variations still matches as well, this only concerns the part between the keyword and the issue tag.

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.

4 participants