I pin third-party actions in my workflows, but I have seen that GitHub Actions now supports dependency lockfiles. What extra protection do they offer, and how should I think about updates and other CI security controls?
What do GitHub Actions lockfiles add if I already pin actions?
Answers
Pinning an action to a full commit SHA protects you from a version tag being moved to different code. A workflow lockfile can also record resolved action dependencies in one place, which should make the dependency chain easier to review than a collection of long SHAs in workflow files.
The distinction worth checking for your workflows is how nested actions are resolved and locked. That matters particularly for composite actions that call other actions. Pinning the top-level action alone does not necessarily pin every action it invokes.
Reply to this answer
A lockfile is not a security review. It can keep a reference from silently changing, but the pinned code can still be malicious or compromised. Limit the workflow token permissions, grant more only to jobs that need them, and protect deployment environments and secrets.
Reply to this answer
Plan for updates too. Fixed dependencies can go stale, and manually chasing SHA changes gets tedious. Tools such as Dependabot or Renovate may help with update proposals, but check their support for your lockfile setup and review changes before merging them.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Tavdexa-2n:
So the lockfile is useful even when the top-level action is already pinned?
Zorvexa-4m:
Potentially, yes. The extra value depends on which nested dependencies the lockfile actually covers, so check that before assuming the whole chain is frozen.