From 3925db4d143f6140ee70523f2b8c037c9fabba94 Mon Sep 17 00:00:00 2001 From: David Losert Date: Sun, 25 Aug 2024 17:21:24 +0200 Subject: [PATCH] chore: Fixes wrong boolean logic --- src/inputs/options.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/inputs/options.ts b/src/inputs/options.ts index d8257f2..376f40a 100644 --- a/src/inputs/options.ts +++ b/src/inputs/options.ts @@ -80,8 +80,9 @@ async function getPrNumber(octokit: Octokit): Promise { const prNumberFromInput = core.getInput("pr-number"); const processedPrNumber: number | undefined = Number(prNumberFromInput); - // The user defined Number will always take precedence - if (Number.isSafeInteger(processedPrNumber) && processedPrNumber <= 0) { + // Check if it is a full integer. Check for non-null as qhen the option is not set, the parsed input will be an empty string + // which becomes 0 when parsed to a number. + if (Number.isSafeInteger(processedPrNumber) && processedPrNumber !== 0) { core.debug(`Received pull-request number: ${processedPrNumber}`); return processedPrNumber; }