Menu

GitHub Actions Cache Never Hits on Pull Requests: Branch Scope, Immutable Keys, and restore-keys
📰

GitHub Actions Cache Never Hits on Pull Requests: Branch Scope, Immutable Keys, and restore-keys

DEV Community: cicd·Libme·about 1 month ago
#UHRq6zIp
#devtocicd#devto#dev#cache#restore
Long article (1492 words) — no AI summary yet.
Reading 0:00
15s threshold

If actions/cache reports "Cache not found" on every pull request even though you can see caches in the repo's Actions tab, the cause is almost always one of three things: the cache was saved on a branch your PR cannot read, the key is identical to an existing one (caches are immutable, so the new content is never saved), or your restore-keys prefix does not match anything. All three are fixable in a few lines of YAML, and you can diagnose which one you have from the job log alone.

What does the failure actually look like?

The symptoms I see most often in logs (wording as of late 2026; the exact text may change between releases):

Cache not found for input keys: Linux-npm-3f1a9c..., Linux-npm-

Enter fullscreen mode

Exit fullscreen mode

and, in the post-job step:

Warning: Failed to save: Unable to reserve cache with key Linux-npm-3f1a9c..., another job may be creating this cache.

Enter fullscreen mode

Exit fullscreen mode

The first line means a restore found nothing.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.