From 4560c23b396d494f0cb7066e1d6e258e8feb8051 Mon Sep 17 00:00:00 2001 From: Yang Cao Date: Fri, 18 Sep 2020 16:04:35 -0400 Subject: [PATCH] Check for invalid retention-days input --- dist/index.js | 3 +++ src/input-helper.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dist/index.js b/dist/index.js index d4a243d..ae13d30 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6405,6 +6405,9 @@ function getInputs() { const retentionDaysStr = core.getInput(constants_1.Inputs.RetentionDays); if (retentionDaysStr) { inputs.retentionDays = parseInt(retentionDaysStr); + if (isNaN(inputs.retentionDays)) { + core.setFailed('Invalid retention-days'); + } } return inputs; } diff --git a/src/input-helper.ts b/src/input-helper.ts index f55aea7..8344823 100644 --- a/src/input-helper.ts +++ b/src/input-helper.ts @@ -31,6 +31,9 @@ export function getInputs(): UploadInputs { const retentionDaysStr = core.getInput(Inputs.RetentionDays) if (retentionDaysStr) { inputs.retentionDays = parseInt(retentionDaysStr) + if (isNaN(inputs.retentionDays)) { + core.setFailed('Invalid retention-days') + } } return inputs