Skip to content

Commit

Permalink
Fix insufficient commentUrlParamsRegex
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanH committed Aug 31, 2022
1 parent 1fa925a commit 42e4abc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)\/(?<owner>[\\w-]+)\/(?<repo>[\\w-]+)\/(?:issues)\/(?<issue_number>[0-9]+)"
"(?:https:\/\/)(?:api\.github\.com)\/(?:repos)\/(?<owner>[\\w.-]+)\/(?<repo>[\\w.-]+)\/(?:issues)\/(?<issue_number>[0-9]+)"
);

0 comments on commit 42e4abc

Please sign in to comment.