- Symptom
- Cache hit occurred on the primary key node-cache, not saving cache.Dependencies or build output in the cache stay stale for weeksChanging files under the cached path does not change what is restored
- Cause
- A cache entry is immutable once saved, so a key that never changes is restored forever and never written again. New content needs a new key.
- Fix
- Put a content hash in the key and use restore-keys for partial matches.
- Apply
- uses: actions/cache@v4 with: path: ~/.npm key: npm-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | npm-${{ runner.os }}-- Affected
- actions/cache v3 and v4 on github.com, as of October 2026
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders