snok / container-retention-policy

GitHub action for pruning old GHCR container image versions.
MIT License
186 stars 30 forks source link

wip: Fetch multi-platform image digests #89

Open sondrelg opened 3 months ago

sondrelg commented 3 months ago

Work in progress.

Fetches image digests for the user, possibly making the ingore-shas input redundant. I thought we wouldn' be able to do this, but this seems to work:

curl -H "X-GitHub-Api-Version: 2022-11-28" \
     -H "Accept: application/vnd.oci.image.index.v1+json" \
     -H "Authorization: Bearer <base64-encoded token>" \
     https://ghcr.io/v2/snok%2Fcontainer-retention-policy/manifests/v3.0.0

Docs available at https://github.com/distribution/distribution/blob/main/docs/content/spec/api.md