add defaulting to warn when if-no-files-found parameter is not given

This commit is contained in:
Umut 2022-09-26 13:00:09 +03:00
parent 3cea537223
commit 32f2b1ee45
No known key found for this signature in database
GPG key ID: 1E2D84A7A8359270
3 changed files with 12 additions and 7070 deletions

4
dist/index.js vendored
View file

@ -7177,7 +7177,9 @@ function getInputs() {
const name = core.getInput(constants_1.Inputs.Name); const name = core.getInput(constants_1.Inputs.Name);
const path = core.getInput(constants_1.Inputs.Path, { required: true }); const path = core.getInput(constants_1.Inputs.Path, { required: true });
const ifNoFilesFound = core.getInput(constants_1.Inputs.IfNoFilesFound); const ifNoFilesFound = core.getInput(constants_1.Inputs.IfNoFilesFound);
const noFileBehavior = constants_1.NoFileOptions[ifNoFilesFound]; const noFileBehavior = !ifNoFilesFound || ifNoFilesFound === ''
? constants_1.NoFileOptions.warn
: constants_1.NoFileOptions[ifNoFilesFound];
if (!noFileBehavior) { if (!noFileBehavior) {
core.setFailed(`Unrecognized ${constants_1.Inputs.IfNoFilesFound} input. Provided: ${ifNoFilesFound}. Available options: ${Object.keys(constants_1.NoFileOptions)}`); core.setFailed(`Unrecognized ${constants_1.Inputs.IfNoFilesFound} input. Provided: ${ifNoFilesFound}. Available options: ${Object.keys(constants_1.NoFileOptions)}`);
} }

7073
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -10,7 +10,10 @@ export function getInputs(): UploadInputs {
const path = core.getInput(Inputs.Path, {required: true}) const path = core.getInput(Inputs.Path, {required: true})
const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound) const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
const noFileBehavior: NoFileOptions = NoFileOptions[ifNoFilesFound] const noFileBehavior: NoFileOptions =
!ifNoFilesFound || ifNoFilesFound === ''
? NoFileOptions.warn
: NoFileOptions[ifNoFilesFound]
if (!noFileBehavior) { if (!noFileBehavior) {
core.setFailed( core.setFailed(