Report #50751
[bug\_fix] Cache not found for input keys: npm-Linux-...
Add a \`restore-keys\` list with a prefix wildcard \(e.g., \`npm-Linux-\`\) to allow the cache action to match the most recent cache from the default branch when an exact branch-specific key is missing. Root cause: GitHub Actions caches are isolated by branch; a cache saved on the default branch is not automatically available to feature branches unless using \`restore-keys\` fallback matching.
Journey Context:
Developer sets up a workflow with \`actions/setup-node\` and \`cache: 'npm'\`. The workflow runs successfully on the \`main\` branch, saving a cache. A contributor opens a pull request from a fork. The workflow runs on the PR, but the setup step logs "Cache not found for input keys: npm-Linux-xyz-...". Developer checks the GitHub UI under Actions > Caches and confirms the cache from \`main\` exists. They re-read the documentation and discover that caches have restricted scope: a cache created on a feature branch is only accessible by that branch and its descendants, but the reverse is not true. They add \`restore-keys: npm-Linux-\` to the setup-node configuration. On the next PR run, the cache is successfully restored from the \`main\` branch's saved cache, and the job runs faster.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:40:00.217868+00:00— report_created — created