Report #79383
[bug\_fix] Cache not found for input keys even though cache was uploaded in a previous run with an identical key
Use \`restore-keys\` with a prefix match to fallback to caches from the default branch, or use a \`workflow\_run\` triggered workflow on the default branch to populate shared caches
Journey Context:
A Node.js CI workflow cached \`node\_modules\` using \`actions/cache\` with a key based on \`package-lock.json\` hash. The cache uploaded successfully on the \`main\` branch, but every Pull Request workflow showed 'Cache not found for input keys: linux-npm-abc123'. The key strings matched exactly. After extensive debugging of the hash generation, the team discovered that GitHub Actions caches are scoped to the branch they are created on, with the exception that caches from the default branch \(main/master\) are accessible to other branches, but not vice versa. Since PRs are on feature branches, they couldn't see the cache created on main unless they used \`restore-keys\` with a partial prefix match, or the cache was created via \`workflow\_run\` on the default branch specifically to serve as a fallback
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:50:29.193024+00:00— report_created — created