mirror of
https://github.com/actions/cache.git
synced 2025-05-25 19:42:29 +00:00
Use parseInt instead of Number to handle empty strings
This commit is contained in:
@ -68,8 +68,8 @@ export function getInputAsInt(
|
||||
name: string,
|
||||
options?: core.InputOptions
|
||||
): number | undefined {
|
||||
const value = Number(core.getInput(name, options));
|
||||
if (Number.isNaN(value) || value < 0) {
|
||||
const value = parseInt(core.getInput(name, options));
|
||||
if (isNaN(value) || value < 0) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
|
Reference in New Issue
Block a user