Github Container registry (ghcr.io) packages not appearing in api #26627
-
Is there any way to query the ghcr type packages using the github api (rest or graphql)? This graphql query seems to only lists the “old” type of Docker packages (docker.pkg.github.io):
Am I looking in the wrong place? Thanks a lot for any advice! |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments
-
Having the same issue. Only old packages using |
Beta Was this translation helpful? Give feedback.
-
anyone any idea? (even if it’s not possible yet to manage ghcr containers via the API it would be great to get a quick confirmation). Thanks!! |
Beta Was this translation helpful? Give feedback.
-
Sorry about the delay!
christian-korneck:
I’m afraid it isn’t possible to manage ghcr containers via the GraphQL API. The previous registry version was heavily based on GraphQL. This is a very different beast and will likely have a different API. |
Beta Was this translation helpful? Give feedback.
-
Hi @jcansdale, is there any ETA for delivery ? |
Beta Was this translation helpful? Give feedback.
-
nohaapav:
No specific ETA. I’ve confirmed that the team are working on a REST API for this. Keep an eye on the change log: I’ll try to report back here as well! |
Beta Was this translation helpful? Give feedback.
-
thanks @jcansdale, I think that answers my question. |
Beta Was this translation helpful? Give feedback.
-
same here 😦 |
Beta Was this translation helpful? Give feedback.
-
Is there a timeline for when we might see this? With the DockerApocalypse coming on Monday this is quickly becoming more and more relevant. |
Beta Was this translation helpful? Give feedback.
-
Just hit this today when trying to create some automation to clean up old images from GHCR |
Beta Was this translation helpful? Give feedback.
-
👋 @benc-uk We’re actively talking about this exact use case, and a delete REST endpoint will likely be the first API we expose to our customers for Container Registry. We are hoping to expose such an endpoint before end of year. |
Beta Was this translation helpful? Give feedback.
-
Will you support the Docker Registry API for image deletion, or are you planning something GHCR specific? I think a generic solution would be preferable. Not that I’d mind an additional GHCR API for additional features, of course (especially if it offers something similar to |
Beta Was this translation helpful? Give feedback.
-
Hi Whitney, Is there any update on this REST endpoint? I would, also, like to be able to modify permissions on an image and, if possible, trigger a GH action when an image has been pushed. |
Beta Was this translation helpful? Give feedback.
-
Hello! Is there any progress on this? The old repository-bound container package registry is deprecated and the new one does not show up in the GraphQL APIs yet. It would be really helpful to have this so we can automate package deletion. This is actively blocking us from migrating to the new registry and that in terms is blocking us from upgrading to K8s 1.20 which does only work with the new registry. |
Beta Was this translation helpful? Give feedback.
-
Hi @rubengees,
rubengees:
Yes, the new REST API has been released! You can find it here: docs.github.comPackages - GitHub Docs//docs.github.com/en/rest/reference/packages Here is a blog post about package deletion (including public packages) for all registries: The GitHub BlogPackages: delete and restore for all packages - GitHub ChangelogPackages: delete and restore for all packages Please let me know if you have any further questions. |
Beta Was this translation helpful? Give feedback.
-
The docs state "GraphQL is not supported for containers or Docker images at So how are we supposed to bulk delete many old images in GH Container Registry ? |
Beta Was this translation helpful? Give feedback.
-
You can use the REST Api like @jcansdale mentioned, this way you can build any automation you want. I also adjusted the packages action which can now remove old versions from ghcr. However I just opened a thread here where I am wondering if we can also use the GITHUB_TOKEN instead of a Personal Access Token.
Hello, I just saw the changelog entry which now introduced access for the container registry. There it mentions that the secrets.GITHUB_TOKEN now has full access including reading and deleting for the ghcr registry. However, switching from PAT to the GITHUB_TOKEN and adding permissions (push works fine with new token), now my custom action to list and then delete containers from ghcr.io throws: Best regards |
Beta Was this translation helpful? Give feedback.
No specific ETA. I’ve confirmed that the team are working on a REST API for this.
Keep an eye on the change log:
https://github.blog/changelog/
I’ll try to report back here as well!