Fail if unrecognized input

This commit is contained in:
Konrad Pabjan 2020-07-28 14:08:29 +02:00
parent 34a91c2db4
commit 91b12310e9
2 changed files with 11 additions and 0 deletions

View file

@ -12,6 +12,14 @@ export function getInputs(): UploadInputs {
const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
const noFileBehavior: NoFileOptions = NoFileOptions[ifNoFilesFound]
if (!noFileBehavior) {
core.setFailed(
`Unrecognized if-no-files-found input. Provided ${ifNoFilesFound}. Available options include ${Object.keys(
NoFileOptions
).map(k => NoFileOptions[k as string])}`
)
}
return {
artifactName: name,
searchPath: path,