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 bb3fe21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ 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,
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 bb3fe21

Please sign in to comment.