diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..5bcf9c6e --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v24.18.0 diff --git a/jira-integration/.nvmrc b/jira-integration/.nvmrc deleted file mode 100644 index 016e34ba..00000000 --- a/jira-integration/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v20.17.0 diff --git a/jira-integration/dist/index.mjs b/jira-integration/dist/index.mjs index afb1f6c0..dd017151 100644 --- a/jira-integration/dist/index.mjs +++ b/jira-integration/dist/index.mjs @@ -36253,8 +36253,8 @@ function extractResolvedIssueKeys(prBody, comments) { // It’s extremely important for this regexp to match only simple // jira keys as extracted keys will be used in JQL queries. const issueKeyRegExp = '[A-Z][A-Z0-9]+-[0-9]+' - const urlRegExp = `${jiraApiBaseUrl.origin}/browse/(${issueKeyRegExp})` - const closesRegExp = `${keywordsRegExp}${urlRegExp}(?:\\s*,\\s*${urlRegExp})*` + const urlRegExp = `${RegExp.escape(jiraApiBaseUrl.origin)}/browse/(${issueKeyRegExp})` + const closesRegExp = `${keywordsRegExp}?(?:\\s*,\\s*?)*` // Find all “Closes URL, URL…” const matches = text.match(new RegExp(closesRegExp, 'gi')) || [] @@ -36263,10 +36263,10 @@ function extractResolvedIssueKeys(prBody, comments) { new Set( matches.flatMap((match) => { // Find URLs - const urlMatches = match.match(new RegExp(urlRegExp, 'g')) + const urlMatches = match.match(new RegExp(urlRegExp, 'gi')) // Find issueId in the URL (only capture group in urlRegExp) - const issueKeys = urlMatches.map( - (url) => url.match(new RegExp(urlRegExp))[1] + const issueKeys = urlMatches.map((url) => + url.match(new RegExp(urlRegExp, 'i'))[1].toUpperCase() ) return issueKeys }) diff --git a/jira-integration/index.mjs b/jira-integration/index.mjs index eec29c8b..c7cfe9e3 100644 --- a/jira-integration/index.mjs +++ b/jira-integration/index.mjs @@ -177,8 +177,8 @@ function extractResolvedIssueKeys(prBody, comments) { // It’s extremely important for this regexp to match only simple // jira keys as extracted keys will be used in JQL queries. const issueKeyRegExp = '[A-Z][A-Z0-9]+-[0-9]+' - const urlRegExp = `${jiraApiBaseUrl.origin}/browse/(${issueKeyRegExp})` - const closesRegExp = `${keywordsRegExp}${urlRegExp}(?:\\s*,\\s*${urlRegExp})*` + const urlRegExp = `${RegExp.escape(jiraApiBaseUrl.origin)}/browse/(${issueKeyRegExp})` + const closesRegExp = `${keywordsRegExp}?(?:\\s*,\\s*?)*` // Find all “Closes URL, URL…” const matches = text.match(new RegExp(closesRegExp, 'gi')) || [] @@ -187,10 +187,10 @@ function extractResolvedIssueKeys(prBody, comments) { new Set( matches.flatMap((match) => { // Find URLs - const urlMatches = match.match(new RegExp(urlRegExp, 'g')) + const urlMatches = match.match(new RegExp(urlRegExp, 'gi')) // Find issueId in the URL (only capture group in urlRegExp) - const issueKeys = urlMatches.map( - (url) => url.match(new RegExp(urlRegExp))[1] + const issueKeys = urlMatches.map((url) => + url.match(new RegExp(urlRegExp, 'i'))[1].toUpperCase() ) return issueKeys })