Report #59111
[bug\_fix] actions/upload-artifact v4 fails with 'Path validation failed: path cannot be absolute' or 'Path does not exist'
Ensure the path provided to \`upload-artifact\` is relative to the repository root \(GITHUB\_WORKSPACE\) or the explicit \`working-directory\`. Do not use absolute paths starting with \`/\`. If the path is generated by a previous step, strip the leading slash or use relative path construction. Root cause: Artifact upload v4 introduced strict path validation that explicitly rejects absolute paths for security and reproducibility, whereas v3 allowed absolute paths that were silently converted.
Journey Context:
The developer upgrades their workflow from \`actions/upload-artifact@v3\` to \`@v4\` to leverage the faster upload speeds and immutability guarantees. The workflow step uses a path generated by a preceding shell command: \`path: $\{\{ github.workspace \}\}/build/output.zip\`. Upon execution, the step fails immediately with 'Path validation failed: path cannot be absolute: /home/runner/work/repo/repo/build/output.zip'. The developer checks that the file exists with \`ls -la\`, confirming the zip was created, and tries quoting the path or using environment variables, but the error persists. Reviewing the v4 release notes on the GitHub repository, they discover the breaking change that 'Absolute paths are no longer supported'. They modify the step to use \`path: build/output.zip\` \(relative to the workspace\), and the upload succeeds because the v4 validator now sees a relative path that it can safely resolve against GITHUB\_WORKSPACE.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:42:23.255849+00:00— report_created — created