DEV Community
No files were found with the provided path in upload-artifact
The message no files were found with the provided path is not a statement about your artifact, it is the result of a glob: actions/upload-artifact expanded its path input against the runner filesystem and got an empty list. Whether that ends the job, warns, or says nothing is decided by if-no-files-found, and the default lets the build stay green. One sentence, three severities. The default is a warning, which is why this usually surfaces as a download failure in another job. What this error means The same sentence appears whether the step warned, failed or stayed silent, because all three branches emit identical text at different severities. The line below is the error one, from a run that had set if-no-files-found: error. At the shipped default the upload step is yellow rather than red, the job finishes, and the run looks fine. Minutes later a different job fails because the artifact it wanted is not there, and that is the failure people report. The line names an absolute path on the runner, which is worth reading carefully: it is the path the action resolved, not the one you typed. ```Actions log, quoted from upload-artifact#810 [error]No files were found with the provided path: /__w/_temp/release-assets. No artifacts will be uploaded.
Common causes
The build wrote to a different directory than the upload reads
The ordinary case, and the one the illustrative workflow shows. A working-directory on the build step, a build tool with its own output root, or a monorepo where each package writes into itself all put files where the upload path does not reach. The absolute path in the message is the whole diagnosis.
The step that should have produced the files did not run
A conditional step that evaluated false, a cached step that short-circuited, or a build that failed under continue-on-error all leave the directory empty. This looks identical in the log to a wrong path, which is why listing the directory before the upload is worth the two seconds.
Everything the pattern matched is a directory or a hidden file
Directories are filtered out of the match list, so a tree of empty directories uploads nothing. Hidden files have been excluded by default since version 4.4.0, so a path containing only dotfiles, a .next build that is being uploaded wholesale, or a coverage directory whose entries begin with a dot now matches zero files where it once matched many.
The path is right for a shell and wrong for an action
Tilde expansion, environment variables in shell syntax and relative paths borrowed from a run: block are the recurring near misses, because the action has its own handling for all three and it is not the shell one. In a container job the workspace is mapped as well, so even an absolute path can resolve differently between steps.
How to fix it
Make the empty match the failure
Do this first, before diagnosing anything. With if-no-files-found: error the run goes red on the step that has the path in front of it, rather than in a different job with a message about a missing artifact. On any upload a later job consumes, this is the default to write.
```.github/workflows/ci.yml, corrected (illustrative)
- uses: actions/upload-artifact@v7
with:
name: site
path: packages/app/dist
if-no-files-found: error
Print the directory from the same place the action will read it The cheapest diagnostic is a listing taken from the workspace, which is where the action resolves a relative path. Doing it in the build step working directory proves nothing, because that is the frame the action does not use. ls -la "$GITHUB_WORKSPACE"
find "$GITHUB_WORKSPACE" -maxdepth 3 -name "dist" -type d
Include hidden files only when you mean to If the files you expected begin with a dot, the exclusion added in version 4.4.0 is why they are missing. Turning it back on is one input, and it is worth narrowing the path at the same time: the reason for the change was that whol...
Powered by Readybot.io
External Link
Platform
You are about to visit:
https://example.comThis will open in a new tab. Make sure you trust this link.