Interview Prep/CI/CD/GitHub Actions Failures

Cache is never restored: `Cache not found for input keys`.

AdvancedTroubleshootingGitHub Actions Failures
Answer

Likely causes → Key changes every run (for example includes github.sha); different OS or path; PR branch scope cannot see another branch's cache; evicted due to the repo's cache size limit.

Diagnose → gh cache list; compare keys between runs.

Fix → Use a key based on the lockfile hash with restore-keys fallbacks, and make sure the main branch populates the cache.

Prevent → Monitor cache hit rate; cache package manager directories only.

All CI/CD questions

More on GitHub Actions Failures