Report #71814
[bug\_fix] Cache always misses with 'Cache not found for input keys' despite successful saves in previous runs
Remove dynamic values like \`$\{\{ github.sha \}\}\` or \`$\{\{ github.run\_id \}\}\` from the cache key. Use stable identifiers like \`$\{\{ hashFiles\('\*\*/package-lock.json'\) \}\}\` and implement \`restore-keys\` with partial matching to allow fallback to older caches.
Journey Context:
Developer implements dependency caching using \`actions/cache\` to speed up Node.js builds. Initially using \`$\{\{ hashFiles\('\*\*/package-lock.json'\) \}\}\` as the key, it works correctly. To 'bust' the cache manually, they add \`$\{\{ github.sha \}\}\` to the key, creating a unique key for every commit. The cache save step succeeds, but subsequent runs always show 'Cache not found' because the lookup uses the new commit's SHA. The developer spends hours examining cache storage limits, checking the 'Caches' section in the repository settings, and verifying the cache was actually saved. They eventually examine the key construction in the workflow logs and realize that the dynamic SHA makes the key unique per run, preventing any cache hits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:07:33.294196+00:00— report_created — created