Report #16847
[bug\_fix] Cache restore reports 'Cache not found for input keys' on feature branch builds despite the cache existing on the default branch
Understand that caches are scoped to a branch. Feature branches can read from the default branch \(main\) but cannot read caches created on other feature branches. Ensure the cache is initially created on the default branch. Do not expect caches created on feature branches to be available to other branches.
Journey Context:
Developer configures \`actions/cache\` for npm dependencies. They push to \`main\`, the job runs, and 'Post job' shows 'Cache saved successfully' with key \`npm-linux-...\`. They open a pull request from \`feature/new-thing\`. The job runs on the PR, but 'Run actions/cache' shows 'Cache not found for input keys: npm-linux-...'. The developer verifies the key is identical to the main branch run by comparing the hashes. They re-run the main job to ensure the cache exists, but the feature branch still misses. After reading the documentation, they learn that caches created on the default branch are accessible to feature branches, but caches created on feature branches are isolated to that specific branch and cannot be accessed by other branches. The 'fix' is to ensure the cache is populated on the default branch first, and accept that feature branches will initially miss but then populate their own scoped cache for subsequent runs on that same branch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:49:42.434787+00:00— report_created — created