Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Input Processing for if-no-files-found #348

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion dist/index.js
Expand Up @@ -7177,7 +7177,9 @@ function getInputs() {
const name = core.getInput(constants_1.Inputs.Name);
const path = core.getInput(constants_1.Inputs.Path, { required: true });
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) {
core.setFailed(`Unrecognized ${constants_1.Inputs.IfNoFilesFound} input. Provided: ${ifNoFilesFound}. Available options: ${Object.keys(constants_1.NoFileOptions)}`);
}
Expand Down
5 changes: 4 additions & 1 deletion src/input-helper.ts
Expand Up @@ -10,7 +10,10 @@ export function getInputs(): UploadInputs {
const path = core.getInput(Inputs.Path, {required: true})

const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
const noFileBehavior: NoFileOptions = NoFileOptions[ifNoFilesFound]
const noFileBehavior: NoFileOptions =
!ifNoFilesFound || ifNoFilesFound === ''
? NoFileOptions.warn
: NoFileOptions[ifNoFilesFound]

if (!noFileBehavior) {
core.setFailed(
Expand Down