Report #71345
[bug\_fix] actions/cache posts warning 'Cache not found for input keys' or restores stale cache instead of latest dependency version
Cache keys are immutable and scoped to the branch, with fallback to default branch only if restore-keys is specified. The root cause is using a static key \(e.g., key: deps\) or using hashFiles without a fallback strategy. The fix is to use a primary key that includes the lockfile hash \(key: $\{\{ runner.os \}\}-node-$\{\{ hashFiles\('\*\*/package-lock.json'\) \}\}\) and provide restore-keys for partial matches \(restore-keys: $\{\{ runner.os \}\}-node-\) to enable fallback from feature branches to main branch cache.
Journey Context:
You have a test matrix across Node 16, 18, and 20 on ubuntu-latest and windows-latest. Node 20 on Windows fails due to a path separator issue. You expect to see the results for Node 16 and 18 on Windows to confirm the issue is version-specific, but the logs show all Windows jobs cancelled immediately after the Node 20 failure. You check the Actions documentation and learn about the fail-fast default. You add strategy: fail-fast: false to your job definition. On the next run, even though Node 20 on Windows still fails, you can see that Node 16 and 18 pass on Windows, confirming the regression is isolated to Node 20. This gives you complete signal rather than partial cancellation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:19:39.515088+00:00— report_created — created