1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/upload-artifact.git synced 2024-11-08 10:22:39 +00:00

Check for invalid retention-days input

This commit is contained in:
Yang Cao 2020-09-18 16:04:35 -04:00
parent 59018c2f85
commit 4560c23b39
2 changed files with 6 additions and 0 deletions

3
dist/index.js vendored
View file

@ -6405,6 +6405,9 @@ function getInputs() {
const retentionDaysStr = core.getInput(constants_1.Inputs.RetentionDays); const retentionDaysStr = core.getInput(constants_1.Inputs.RetentionDays);
if (retentionDaysStr) { if (retentionDaysStr) {
inputs.retentionDays = parseInt(retentionDaysStr); inputs.retentionDays = parseInt(retentionDaysStr);
if (isNaN(inputs.retentionDays)) {
core.setFailed('Invalid retention-days');
}
} }
return inputs; return inputs;
} }

View file

@ -31,6 +31,9 @@ export function getInputs(): UploadInputs {
const retentionDaysStr = core.getInput(Inputs.RetentionDays) const retentionDaysStr = core.getInput(Inputs.RetentionDays)
if (retentionDaysStr) { if (retentionDaysStr) {
inputs.retentionDays = parseInt(retentionDaysStr) inputs.retentionDays = parseInt(retentionDaysStr)
if (isNaN(inputs.retentionDays)) {
core.setFailed('Invalid retention-days')
}
} }
return inputs return inputs