diff --git a/src/index.js b/src/index.js index d0070ec..96885a4 100644 --- a/src/index.js +++ b/src/index.js @@ -19,7 +19,7 @@ function getCardNumbers(message) { console.log(`getCardNumber(${message})`); console.log(`Trello ID match pattern ${trelloCardIdPattern}`) let ids = message && message.length > 0 ? message.replace(regexPullRequest, "").match(new RegExp(`${trelloCardIdPattern}\\d+`, 'g')) : []; - return ids && ids.length > 0 ? ids.map(x => x.replace(trelloCardIdPattern, '')) : null; + return ids && ids.length > 0 ? ids.map(x => x.replace(new RegExp(trelloCardIdPattern), '')) : null; } function getAllCardNumbers(message, branch) { @@ -179,4 +179,4 @@ async function run() { } }; -run() \ No newline at end of file +run()