Skip to content

Commit 4d464b0

Browse files
Improve issue ID parsing and validation logic
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 14cefaa commit 4d464b0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎pr-checks/post-comment.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ function parseBoolean(flag: string, value: string | undefined): boolean {
8585
/** Parses and validates `value` as an issue/pull request number. */
8686
function parseIssueId(value: string | undefined): number {
8787
return parseFlag("issue-id", value, (raw) => {
88-
const parsed = Number.parseInt(raw, 10);
89-
if (Number.isNaN(parsed)) {
90-
throw new Error("Must be an integer.");
88+
const parsed = Number(raw);
89+
if (!Number.isInteger(parsed) || parsed <= 0) {
90+
throw new Error("Must be a positive integer.");
9191
}
9292
return parsed;
9393
});

0 commit comments

Comments
 (0)