Report #58152
[bug\_fix] Dependencies lock file is not found in /home/runner/work/... \(cache miss in setup-node with working-directory\)
When using \`working-directory\` in a step or job defaults, explicitly specify the \`cache-dependency-path\` input in \`actions/setup-node\` to point to the lockfile location \(e.g., \`cache-dependency-path: 'frontend/package-lock.json'\`\), because the cache lookup does not respect the \`working-directory\` context.
Journey Context:
In a monorepo, a developer sets \`defaults.run.working-directory: ./frontend\` and uses \`actions/setup-node@v4\` with \`cache: 'npm'\`. The workflow fails immediately with 'Dependencies lock file is not found in /home/runner/work/repo/repo'. The developer confirms \`package-lock.json\` exists in \`./frontend\` and is committed. Enabling step debugging shows \`hashFiles\` is searching the root directory. Realizing that \`setup-node\` runs at the repository root and ignores \`working-directory\` for the cache path, the developer adds \`cache-dependency-path: 'frontend/package-lock.json'\` to the action inputs, resolving the cache miss.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:05:58.950267+00:00— report_created — created