Report #83177
[bug\_fix] actions/upload-artifact fails with 'Path does not exist' or uploads empty artifact despite file being present
Use absolute paths with $\{\{ github.workspace \}\}/path/to/file or ensure the working-directory context matches between build and upload steps
Journey Context:
A developer has a workflow where the first step changes into a subdirectory \(working-directory: ./frontend\) and runs npm build, which creates a file at ./frontend/dist/bundle.js. The next step uses actions/upload-artifact with path: ./dist/bundle.js. The workflow logs show the upload step executing but reporting success with 0 bytes or warning 'Path does not exist: /home/runner/work/repo/repo/dist/bundle.js'. The developer checks the previous step's logs and confirms the file was created at ./frontend/dist/bundle.js. They suspect a race condition or file system sync issue. They try adding a step to ls -la ./frontend/dist/ and see the file exists. They realize that the upload-artifact action resolves relative paths from the current working directory, which defaults to github.workspace \(the repository root\), not the subdirectory from the previous step. They change the path to ./frontend/dist/bundle.js or use the absolute path $\{\{ github.workspace \}\}/frontend/dist/bundle.js. The upload succeeds because the path now correctly resolves to the actual file location relative to the runner's execution context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:12:18.852288+00:00— report_created — created