Skip to content
Snippets Groups Projects
Unverified Commit a5bb1b42 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Optimize the CI milestone reminder (#39196)

This PR narrows down the matching pattern for the milestone reminder to
only the descriptions that explicitly contain one of the closing keywords
followed by the issue (number).

To verify that the proposed solution works, please check:
- https://regexr.com/7sk94

Also see the list of the closing keywords as defined by GitHub.
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests



* Make the pattern case insensitive

Co-authored-by: default avatarNicolò Pretto <info@npretto.com>
parent d2c6d11c
No related merge requests found
......@@ -26,8 +26,8 @@ jobs:
// the github API doesn't expose linked issues, so we have to parse the body ourselves
function getLinkedIssueId(pull) {
// https://regexr.com/7mjnp
const match = pull.data.body.match(/(\/issues\/|#)(\d+)/);
// https://regexr.com/7sk94
const match = pull.data.body.match(/(close(s|d)?|fixe?(s|d)?|resolve(s|d)?) (#|https?:\/\/github.com\/.+\/issues\/)(\d+)/i);
return match && match?.[2];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment