-
Notifications
You must be signed in to change notification settings - Fork 64.1k
fix: GHCR attestation example by listing GHCR first in metadata images #40292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a Docker attestation issue in the GitHub Actions workflow example by reordering the image list in the metadata action. The problem occurred because the attestation step targets GHCR but was trying to fetch a Docker Hub digest, resulting in a 404 error.
Key changes:
- Reorders the image list in
docker/metadata-actionto prioritize GHCR over Docker Hub - Ensures the digest output from
docker/build-push-actionpoints to an existing GHCR manifest
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. The table shows the files in the
Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server 🤖 This comment is automatically generated. |
@LindonAliu Thanks for opening a PR and issue! I'll get an SME to review it and get back to you.
Uh oh!
There was an error while loading. Please reload this page.
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-actionexposes a singledigestoutput. 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
imagesorder 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@v2can fetch the manifest. No more 404.Check off the following: