Replies: 3 comments 1 reply
-
GitHub Container Registry (GHCR.io) currently does not fully support the OCI Distribution Spec’s Referrers API, which is why querying referrers by image SHA returns empty results despite the provenance layers and manifests being present. Although the attest-build-provenance action correctly uploads the provenance as a separate artifact linked via the manifest’s “subject” field per OCI 1.1 spec, GHCR lacks the API endpoint implementation to list those linked artifacts using the referrers API. This means you cannot retrieve provenance starting solely from the image SHA via standard referrers API calls on GHCR.io. Instead, the provenance can be accessed by directly fetching the known manifest or blob SHA recorded in the GitHub Actions logs or via GitHub’s own Attestations API, which is GitHub-specific. For a truly generic solution across registries supporting the Docker Registry HTTP V2 API plus OCI extensions, you need a registry that fully implements the Referrers API. Currently, registries like Harbor or newer versions of Docker Distribution may have better support. Until GHCR adds this feature, querying provenance via referrers API is not available there, so your best option remains using GitHub-specific APIs or direct SHA references. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
At the moment, GHCR.io does not support the OCI Referrers API. When you use the How to access it instead:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I have a question as to how I can access the provenance which is generated and pushed to a Container Registry via the attest-build-provenance action (with push-to-registry=true).
As per (https://github.com/actions/attest-build-provenance?tab=readme-ov-file#container-image) the provenance is supposed to be uploaded to the container registry, and a manifest is also created which is supposed to link the newly generated provenance layer with the image SHA by adding it as a 'subject' (as per OCI 1.1). (https://github.com/sigstore/cosign/blob/main/specs/BUNDLE_SPEC.md#publishing)
This is then supposed to allow the provenance to be queried via the 'referrers API' by listing the referrers for that image SHA. However, I can't ever get any referrers to show up in GCHR.io (via curl).
I am able to directly query the provenance manifest and blob layer which were added (via the SHAs from the GitHub Actions logs) but I don't understand how I'm supposed to be able to retrieve this provenance starting from just the image SHA?
Does GHCR.io support the 'referrers API'? (https://github.com/opencontainers/distribution-spec/blob/main/spec.md#listing-referrers)
(yes I know I can use the GitHub Attestations API to retrieve the same information but I'm looking for a general solution which works on all registries which implement Docker Container Registry HTTP V2 API)
Beta Was this translation helpful? Give feedback.
All reactions