Skip to content

ci: stop node_modules cache restore-keys poisoning#40

Merged
boris91 merged 1 commit into
tetherto:mainfrom
andretetherio:ci-cache-fix
Jun 17, 2026
Merged

ci: stop node_modules cache restore-keys poisoning#40
boris91 merged 1 commit into
tetherto:mainfrom
andretetherio:ci-cache-fix

Conversation

@andretetherio

Copy link
Copy Markdown
Contributor

Summary

  • Remove restore-keys from the save step of .github/actions/node-setup-cache.

Why

On a lockfile change the new exact cache key misses, restore-keys then matches the previous cache, and stale node_modules get restored over the fresh install and re-saved under the new key — so CI silently runs with outdated deps (this is what let a pinned vite bump keep resolving to the old major in PR #38).

Dropping restore-keys on the save path forces a clean install whenever the lockfile changes. The companion node-restore-cache action keeps its prefix fallback (read-only, safe speedup).

Test plan

  • On a PR that changes package-lock.json, confirm the cache key misses and a fresh npm ci runs (no stale restore).
  • On a PR with no lockfile change, confirm the exact-key cache still hits.

@andretetherio
andretetherio requested review from a team as code owners June 16, 2026 18:26
boris91
boris91 previously approved these changes Jun 16, 2026
The setup-cache action saved node_modules with a restore-keys prefix
fallback. On a lockfile change the new exact key misses, restore-keys
matches the previous cache, and stale node_modules get restored over a
fresh install and re-saved under the new key — serving outdated deps
(e.g. a pinned vite bump still resolving to the old major). Dropping
restore-keys here forces a clean install on any lockfile change; the
restore-cache action keeps its prefix fallback for read-only speedups.
@boris91
boris91 merged commit b065a0c into tetherto:main Jun 17, 2026
162 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants