Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v24.18.0
1 change: 0 additions & 1 deletion jira-integration/.nvmrc

This file was deleted.

10 changes: 5 additions & 5 deletions jira-integration/dist/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions jira-integration/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}<?${urlRegExp}>?(?:\\s*,\\s*<?${urlRegExp}>?)*`

// Find all “Closes URL, URL…”
const matches = text.match(new RegExp(closesRegExp, 'gi')) || []
Expand All @@ -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
})
Expand Down