Track 09 · Lesson 4 of 9Shipping safely

Track 09 · Shipping 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@v45
  • A base image

    FROM node:24-alpine
  • An install script

    curl -fsSL https://get.example-cli.dev | sh
  • A 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 curl into sh.

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

MediumDevOps

Unpinned 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

What does pinning an action by commit SHA protect against?