A third-party action is used in 80 workflows. Security asks how you will control supply-chain risk.
AdvancedScenarioGitHub Actions
Answer
Situation read → Mutable tags like @v4 can be moved by the action's maintainer or an attacker.
What I'd do →
- Pin to full commit SHAs with a version comment:
uses: actions/checkout@<40-char-sha> # v4.2.2. - Let Dependabot or Renovate update the SHAs with reviewable PRs.
- Set the org policy to allow only GitHub-owned and an allow-list of actions.
- Prefer a few vetted actions; for simple tasks use plain
runsteps.
Why → A compromised tag is exactly how past action supply-chain attacks spread.
Interview tip → Mention SHA pinning plus an org-level allow-list.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate