fix: GHCR attestation example by listing GHCR first in metadata images #40292
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.
The attestation step targets GHCR, but docker/build-push-action exposes the digest for the first image produced by docker/metadata-action. The previous doc snippet listed Docker Hub first, so the attestation attempted to fetch a Docker Hub digest from GHCR, resulting in 404.
Why:
Closes: #40291
docker/build-push-action
exposes a singledigest
output. In practice, that digest aligns with the first image target from the tags generated bydocker/metadata-action
.In the original file, Docker Hub (
lindon18/glu
) was listed before GHCR. The attestation then tried to fetch that digest on GHCR, which did not exist yet → 404.Error excerpt:
Run: https://github.com/glu-lang/glu/actions/runs/17557475866/job/49865233829
What's being changed (if available, include any code snippets, screenshots, or gifs):
Fix
Reverse the
images
order so GHCR comes first. This makes${{ steps.push.outputs.digest }}
point to a manifest that exists on GHCR when the attestation runs.Minimal diff
Why it works
actions/attest-build-provenance@v2
can fetch the manifest. No more 404.Check off the following: