Skip to content

Commit 4560c23

Browse files
committed
Check for invalid retention-days input
1 parent 59018c2 commit 4560c23

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6405,6 +6405,9 @@ function getInputs() {
64056405
const retentionDaysStr = core.getInput(constants_1.Inputs.RetentionDays);
64066406
if (retentionDaysStr) {
64076407
inputs.retentionDays = parseInt(retentionDaysStr);
6408+
if (isNaN(inputs.retentionDays)) {
6409+
core.setFailed('Invalid retention-days');
6410+
}
64086411
}
64096412
return inputs;
64106413
}

src/input-helper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export function getInputs(): UploadInputs {
3131
const retentionDaysStr = core.getInput(Inputs.RetentionDays)
3232
if (retentionDaysStr) {
3333
inputs.retentionDays = parseInt(retentionDaysStr)
34+
if (isNaN(inputs.retentionDays)) {
35+
core.setFailed('Invalid retention-days')
36+
}
3437
}
3538

3639
return inputs

0 commit comments

Comments
 (0)