mirror of
https://github.com/actions/upload-artifact.git
synced 2025-04-19 15:04:45 +02:00
Fail if unrecognized input
This commit is contained in:
parent
34a91c2db4
commit
91b12310e9
2 changed files with 11 additions and 0 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -6374,6 +6374,9 @@ function getInputs() {
|
||||||
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 = constants_1.NoFileOptions[ifNoFilesFound];
|
||||||
|
if (!noFileBehavior) {
|
||||||
|
core.setFailed(`Unrecognized if-no-files-found input. Provided ${ifNoFilesFound}. Available options include ${Object.keys(constants_1.NoFileOptions).map(k => constants_1.NoFileOptions[k])}`);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
artifactName: name,
|
artifactName: name,
|
||||||
searchPath: path,
|
searchPath: path,
|
||||||
|
|
|
@ -12,6 +12,14 @@ export function getInputs(): UploadInputs {
|
||||||
const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
|
const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
|
||||||
const noFileBehavior: NoFileOptions = NoFileOptions[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 {
|
return {
|
||||||
artifactName: name,
|
artifactName: name,
|
||||||
searchPath: path,
|
searchPath: path,
|
||||||
|
|
Loading…
Add table
Reference in a new issue