From 42e4abcd29c1e62025da04dac6ae6d14a7b73bc1 Mon Sep 17 00:00:00 2001 From: GiovanH Date: Tue, 30 Aug 2022 20:40:09 -0500 Subject: [PATCH] Fix insufficient commentUrlParamsRegex --- src/run.js | 10 +++++++++- src/utils/utils.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/run.js b/src/run.js index c160089..bc7d7f9 100644 --- a/src/run.js +++ b/src/run.js @@ -94,7 +94,15 @@ export async function run() { } const commentParams = commentUrlParamsRegex.exec(subjectUrl); - + console.debug( + "Extracting groups", + commentParams, + "from url", + subjectUrl, + "using regex", + commentUrlParamsRegex + ); + return octokit.issues.createComment({ ...commentParams.groups, body: config.message, diff --git a/src/utils/utils.js b/src/utils/utils.js index 34d1ba4..cdc2b52 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -17,5 +17,5 @@ export function isBot(commentData) { export const commentUrlParamsRegex = new RegExp( // Otherwise, the escape characters are removed from the expression. // eslint-disable-next-line prettier/prettier, no-useless-escape - "(?:https:\/\/)(?:api\.github\.com)\/(?:repos)\/(?[\\w-]+)\/(?[\\w-]+)\/(?:issues)\/(?[0-9]+)" + "(?:https:\/\/)(?:api\.github\.com)\/(?:repos)\/(?[\\w.-]+)\/(?[\\w.-]+)\/(?:issues)\/(?[0-9]+)" );