Track 09 · Lesson 4 of 9Shipping safely
Pinning and the supply chain
Lesson 4 of 9· 6 min
Every action, image and tool your build pulls in runs with your secrets in scope. A tag like @v4 or node:24-alpine is a label its owner can move, and so can anyone who steals their account.
Pin it, then break it
Pin references, then trigger the two events
A third-party action
uses: acme/changed-files@v45A base image
FROM node:24-alpineAn install script
curl -fsSL https://get.example-cli.dev | shA global tool
npm i -g example-cli
Pin to exact bytes#
- Actions by full commit SHA, with the version in a comment:
uses: org/action@<40-character sha> # v4.2.2. - Images by digest:
FROM node:24-alpine@sha256:…. - Tools by exact version, and install scripts by downloading a release and checking its hash instead of piping
curlintosh.
This isn’t hypothetical. In March 2025, the tags of a widely used GitHub Action were re-pointed to code that printed CI secrets into public build logs; every workflow using a tag picked it up on its next run.
Pins need a gardener#
A pin that never moves misses security fixes. Let Dependabot or Renovate watch packages, actions and images, and propose each update as a pull request that CI tests and a human merges.
In a code review
MediumDevOpsUnpinned actions, images and CLIs
Fix: Pin actions by SHA, images by digest, tools by version; let Dependabot or Renovate propose updates.
0 of 3 checked
Check yourself