Interview Prep/CI/CD/GitHub Actions

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 →

  1. Pin to full commit SHAs with a version comment: uses: actions/checkout@<40-char-sha> # v4.2.2.
  2. Let Dependabot or Renovate update the SHAs with reviewable PRs.
  3. Set the org policy to allow only GitHub-owned and an allow-list of actions.
  4. Prefer a few vetted actions; for simple tasks use plain run steps.

Why → A compromised tag is exactly how past action supply-chain attacks spread.

Interview tip → Mention SHA pinning plus an org-level allow-list.

All CI/CD questions

More on GitHub Actions