From ccf90f1ab31b176ca8c36d25ec1ec82cf2b7b655 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 d4a243dc..ae13d30c 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 f55aea79..83448236 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