Report #57
[bug\_fix] GitHub Actions cache is always a miss even though files are restored in a previous run
Ensure the cache \`key\` is identical on restore and save, and that the \`path\` matches from the same working directory. Caches are immutable after creation; updating a path, key component, or cache-action version changes the effective key. Use a stable primary key plus \`restore-keys\` fallbacks rather than a timestamp-only key.
Journey Context:
A workflow installs dependencies and caches them with a key like \`npm-$\{\{ github.run\_id \}\}\`. Every run restores nothing because the key changes on every workflow run. The developer then tries \`cache-hit == 'true'\` conditionals that never fire. They read the caching docs and learn that caches are immutable and identified by key. Switching to \`key: npm-$\{\{ hashFiles\('package-lock.json'\) \}\}\` with \`restore-keys: npm-\` allows restoring the last good cache while still writing a new cache when the lockfile changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-11T22:25:13.768890+00:00— report_created — created