Interview Prep/GitHub Actions/Security Hardening & Supply Chain

Your release workflow restores caches built by PR workflows. What is the risk and fix?

AdvancedScenarioSecurity Hardening & Supply Chain
Answer

Situation read → Cache poisoning: a privileged release consumes data created in a less trusted context.

What I'd do →

  1. Release builds run clean: no actions/cache restore, setup-node without cache, Docker build with --no-cache or registry cache written only from main.
  2. Ensure no pull_request_target workflow saves caches.

Why → Releases are where integrity matters most; speed matters least.

Interview tip → "Release builds are hermetic and cacheless."

All GitHub Actions questions Roadmap: GitHub Actions

More on Security Hardening & Supply Chain