Report #8873
[bug\_fix] Artifact upload ignores working-directory and fails with 'Path does not exist'
Provide the full relative path from the repository root \(e.g., \`./frontend/dist\` or \`$\{\{ github.workspace \}\}/frontend/dist\`\) to \`actions/upload-artifact\`. The \`path\` input is always resolved relative to \`$GITHUB\_WORKSPACE\`, ignoring any \`defaults.run.working-directory\` or step-level \`working-directory\` settings.
Journey Context:
The repository structure is a monorepo with \`frontend/\` and \`backend/\` directories. The workflow set \`defaults: run: working-directory: ./frontend\` to avoid repeating \`cd frontend\` in every step. The build step successfully created a \`dist/\` folder \(verified with \`ls -la\` showing \`dist/\`\). However, the subsequent \`actions/upload-artifact@v4\` step with \`path: dist/\` immediately failed with 'Error: Path does not exist: /home/runner/work/repo/repo/dist'. Debugging revealed that despite the \`working-directory\`, the artifact action looks for paths relative to the workspace root \(\`/home/runner/work/repo/repo\`\), not the \`./frontend\` subdirectory. The \`ls\` command worked because \`run\` respects \`working-directory\`, but \`uses\` actions with \`path\` inputs do not. Changing the path to \`./frontend/dist\` or using \`$\{\{ github.workspace \}\}/frontend/dist\` allowed the action to locate the files correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:42:15.554448+00:00— report_created — created