Report #78944
[bug\_fix] Cache not found for input keys despite cache existing in repository
Ensure the cache is first created on the default branch \(main/master\), or configure \`restore-keys\` with a prefix to allow fallback to less specific cache keys. Root cause: GitHub Actions cache scope restricts access based on the branch where the cache was created. A cache created on a feature branch is only accessible from that specific branch and its descendants, not from the default branch or other unrelated branches.
Journey Context:
A developer sets up dependency caching using \`actions/cache\` with a key based on \`package-lock.json\`. They push to a feature branch, the workflow runs, and the cache is successfully saved. They open a PR to \`main\`. The CI runs on the PR and reports "Cache not found for input keys: linux-npm-abc123". The developer checks the repository's Caches section under Actions and sees the cache entry exists. They try re-running the failed job, but it still misses. They suspect a hashing mismatch, but the key is identical. After reading the documentation on cache restrictions, they learn that caches are branch-scoped. The cache created on the feature branch is not visible to the main branch. They merge a separate PR that creates the cache on main first, or they configure \`restore-keys\` to \`$\{\{ runner.os \}\}-npm-\` which allows falling back to any npm cache from any branch, solving the immediate CI slowdown.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:06:07.193457+00:00— report_created — created