fix: pin the runtime image by digest, not tag - #2
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
action.ymlreferred to the image by mutable tag:Now by digest:
Why
Consumers pin this action by commit SHA. That pin is only as strong as what
action.ymlresolves 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 againstghcr.io/v2/.../manifests/sha256:78d4769...).Release process
Digest pinning only holds if each release updates
action.yml.publish-image.ymlnow reports the digest it pushed, to the log and the job summary, so the next version can be pinned without hunting for it.actionlintandzizmorclean.After merge
Tag a new version, then re-pin the consuming repos to this commit — the previously pinned SHA still carries the tag reference.