Interview Prep/GitHub Actions/Caching, Artifacts, Builds & Scans

`Cache not found for input keys: npm-Linux-3f9a...` on every single run.

BeginnerTroubleshootingCaching, Artifacts, Builds & Scans
Answer

Likely causes → The key contains something that changes every run (github.sha, run_id, a timestamp), the lockfile is not committed so hashFiles returns empty, no restore-keys fallback, or caches were saved only on PR refs and are invisible to other branches.

Diagnose →

gh cache list --limit 20
git ls-files | grep lock

Fix → Key on lockfile hash only, add restore-keys, commit lockfiles, warm caches from main.

Prevent → Use setup-* built-in caching, which generates correct keys.

All GitHub Actions questions Roadmap: GitHub Actions

More on Caching, Artifacts, Builds & Scans