Skip to content

Commit d8a4e47

Browse files
authored
Merge pull request #1992 from gitgitgadget/fix-misleading-parsePRURLInput-error-message
CIHelper.parsePRURLInput: fix misleading error message
2 parents 4506bfb + 7307cd6 commit d8a4e47

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/ci-helper.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,11 @@ export class CIHelper {
263263
}
264264

265265
public parsePRURLInput(): { owner: string; repo: string; prNumber: number } {
266-
const prCommentUrl = core.getInput("pr-url");
266+
const prUrl = core.getInput("pr-url");
267267

268-
const [, owner, repo, prNumber] =
269-
prCommentUrl.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)$/) || [];
268+
const [, owner, repo, prNumber] = prUrl.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)$/) || [];
270269
if (!this.config.repo.owners.includes(owner) || repo !== this.config.repo.name) {
271-
throw new Error(`Invalid PR comment URL: ${prCommentUrl}`);
270+
throw new Error(`Invalid PR URL: ${prUrl}`);
272271
}
273272
return { owner, repo, prNumber: parseInt(prNumber, 10) };
274273
}

0 commit comments

Comments
 (0)