upload-artifact
upload-artifact copied to clipboard
Error: Unrecognized if-no-files-found input. Provided: . Available options: warn,error,ignore
Describe the bug
I'm running a self hosted runner and the workflow job is ran in a container. When a test fails and should upload the screenshots, the following error is displayed. As seen in screenshot below, I have set the if-no-files-found
to ignore
, but error still displays as if this was configured incorrectly.
Version
- [ ] V1
- [x] V2
Environment
- [x] self-hosted
- [ ] Linux
- [ ] Windows
- [ ] Mac
Screenshots
The displayed error message:
The start of the workflow:
If you require more info, let me know.
I'm also facing the same issue
We have similar issue, but as warning and looks like this "if-no-files-found" isn't working.
Warning: Unexpected input(s) 'if-no-files-found', valid inputs are ['name', 'path']
with:
name: test-results
path: target/surefire-reports
if-no-files-found: ignore
Error: Path does not exist /some_path/target/surefire-reports
Error: Exit code 1 returned from process: file name '/home/runner/runners/2.283.3/bin/Runner.PluginHost', arguments 'action "GitHub.Runner.Plugins.Artifact.PublishArtifact, Runner.Plugins"'.
I just want to add.. I'm experiencing this same issue. Also on a self-hosted linux based runner. Nothing I do seems to resolve the error. I've tried leaving the if-no-files-found field out, specified an explicit value, with and with out quotes. Even tried a numerical index. Tried @v2, @v3 and @main They all seem to show the same issue. It does appear to be related to running on a self-hosted runner. Changing only my "runs-on" from self-hosted to ubuntu-latest fixes the issue. For added reference, my self-hosted runner is just a set of simple ubuntu-server headless machine.
edit: update.. oddly enough, the upload succeeds! Despite the error.
Edit: Forked the main branch to try a test.
I modified input-helper.ts with the following. And it at least works now on my self-hosted runner.
For some unknown reason, the noFileBehavior value is coming in as a blank, instead of the default 'warn'.
const ifNoFilesFound = core.getInput(Inputs.IfNoFilesFound)
var noFileBehavior: NoFileOptions = NoFileOptions[ifNoFilesFound]
if (!noFileBehavior) {
noFileBehavior = NoFileOptions['warn']
core.warning(
`Unrecognized ${
Inputs.IfNoFilesFound
} input. Provided: ${ifNoFilesFound}. Available options: ${Object.keys(
NoFileOptions
)}. Defaulting to warn.`
)
}
We are also experiencing this issue. Our configuration looks like the following:
- uses: actions/upload-artifact@v3
with:
name: <artifact-name>
path: |
path/to/file1
path/to/file2
path/to/file3
and exactly the below error is printed once this action runs:
Error: Unrecognized if-no-files-found input. Provided: . Available options: warn,error,ignore
I have tried the below configuration too, with the same error message.
- uses: actions/upload-artifact@v3
with:
name: <artifact-name>
path: |
path/to/file1
path/to/file2
path/to/file3
if-no-files-found: warn
The odd thing is, the upload of files succeed. The problem is that this workflow looks to be failed because of this if-no-files-found
issue.
having the same issue, is there a fix ?
same here!
ain't this a beauty, I am already tired of countless github actions issues we are facing :) I hope it's the last time I ever use it.