Skip to content

Commit

Permalink
chore: Fixes wrong boolean logic
Browse files Browse the repository at this point in the history
  • Loading branch information
davelosert committed Aug 25, 2024
1 parent 3fbb6e9 commit 3925db4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/inputs/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ async function getPrNumber(octokit: Octokit): Promise<number | undefined> {
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;
}
Expand Down

0 comments on commit 3925db4

Please sign in to comment.