Skip to content

fix: pin the runtime image by digest, not tag - #2

Merged
robinbowes merged 2 commits into
masterfrom
chore/pin-image-by-digest
Aug 11, 2026
Merged

fix: pin the runtime image by digest, not tag#2
robinbowes merged 2 commits into
masterfrom
chore/pin-image-by-digest

Conversation

@robinbowes

Copy link
Copy Markdown

What

action.yml referred to the image by mutable tag:

image: docker://ghcr.io/yo61/commitlint-github-action:6.3.0

Now by digest:

image: docker://ghcr.io/yo61/commitlint-github-action@sha256:78d47699285290a64b68853ca36a6b3554955bda1d4d6c430a843817b0e1940a

Why

Consumers pin this action by commit SHA. That pin is only as strong as what action.yml resolves to — a mutable tag means the code actually executed can be replaced without the pinned SHA changing, so the SHA pin bought nothing against a registry-side swap.

The digest is the one published for v6.3.0; verified pullable anonymously (HTTP 200 against ghcr.io/v2/.../manifests/sha256:78d4769...).

Release process

Digest pinning only holds if each release updates action.yml. publish-image.yml now reports the digest it pushed, to the log and the job summary, so the next version can be pinned without hunting for it.

actionlint and zizmor clean.

After merge

Tag a new version, then re-pin the consuming repos to this commit — the previously pinned SHA still carries the tag reference.

action.yml referred to ghcr.io/yo61/commitlint-github-action:6.3.0. A tag
is mutable, so a consumer pinning this action by commit SHA still ended up
resolving a swappable image, which defeats the point of the SHA pin.

Refer to the digest published for v6.3.0 instead, and have the release
workflow report the digest of what it just pushed so action.yml can be
kept in step.
The digest in action.yml was not exercised anywhere: the commitlint job
rewrites action.yml to build from the Dockerfile, so nothing proved the
ghcr.io reference resolves at all.

Restore a job that runs the action unmodified. Upstream's version of this
pulled a version tag and so failed on every PR that bumped the version,
before that image existed; a digest always names an image already
published, so it is safe on every push.
@robinbowes
robinbowes merged commit 501ff7b into master Aug 11, 2026
10 checks passed
@robinbowes
robinbowes deleted the chore/pin-image-by-digest branch August 11, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant