Skip to content

Commit

Permalink
Check for invalid retention-days input
Browse files Browse the repository at this point in the history
  • Loading branch information
yacaovsnc authored and aguibert committed Oct 20, 2020
1 parent 08e6087 commit ccf90f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/index.js
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions src/input-helper.ts
Expand Up @@ -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
Expand Down

0 comments on commit ccf90f1

Please sign in to comment.