Interview Prep/CI/CD/GitHub Actions

How should you pin third-party actions, and why?

AdvancedConceptGitHub Actions
Answer

Tags like @v4 are mutable: a maintainer (or an attacker who compromises the repo) can repoint the tag to malicious code, as happened in the 2025 tj-actions/changed-files incident that leaked secrets from workflow logs. Pinning to a full commit SHA is the only immutable reference.

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2

Add Dependabot for github-actions so SHAs get updated by PR, and allow-list permitted actions in org settings (GitHub also offers an org policy to require SHA pinning).

All CI/CD questions

More on GitHub Actions