ci: fix dangerjs "closes anything_but_not_a_jira_link"

This commit is contained in:
Fu Hanxi
2023-03-16 20:44:26 +08:00
parent 7c090d9a42
commit a0b98e9945

View File

@@ -139,18 +139,21 @@ module.exports = async function () {
const correctJiraClosingLinkFormat = new RegExp( const correctJiraClosingLinkFormat = new RegExp(
`^- Closes ${jiraTicketRegex.source}$` `^- Closes ${jiraTicketRegex.source}$`
); );
if (!correctJiraClosingLinkFormat.test(line)) { const matchedJiraTicket = line.match(jiraTicketRegex);
closingTickets.push({ if (jiraTicketMatched) {
record: line, if (!correctJiraClosingLinkFormat.test(line)) {
ticketName: line.match(jiraTicketRegex)[0], closingTickets.push({
correctFormat: false, record: line,
}); ticketName: matchedJiraTicket[0],
} else { correctFormat: false,
closingTickets.push({ });
record: line, } else {
ticketName: line.match(jiraTicketRegex)[0], closingTickets.push({
correctFormat: true, record: line,
}); ticketName: matchedJiraTicket[0],
correctFormat: true,
});
}
} }
} }
return closingTickets; return closingTickets;