I've been struggling with this as well, so I solved it by using the GitHub Packages REST API to list the package versions and then extracting the tag from the first element in the respose using jq:

curl -s \
      -H "Accept: application/vnd.github+json" \
      -H "Authorization: Bearer <github_token>" \
      -H "X-GitHub-Api-Version: 2022-11-28" \
      https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions | jq '[.[] ] | .[0] .metadata .container .tags[0]'
Answer from Nanor on Stack Overflow
Home
Get started, troubleshoot, and make the most of GitHub. Documentation for new users, developers, administrators, and all of GitHub's products.
REST API
Create integrations, retrieve data, and automate your workflows with the GitHub REST API.
Quickstart
Learn how to get started with the GitHub REST API.
Authenticating
You can authenticate to the REST API to access more endpoints and have a higher rate limit.
🌐
GitHub
docs.github.com › en › packages › learn-github-packages › introduction-to-github-packages
Introduction to GitHub Packages - GitHub Docs
You can integrate GitHub Packages with GitHub's APIs, GitHub Actions, and webhooks to create an end-to-end DevOps workflow that includes your code, CI, and deployment solutions.
🌐
Omi AI
omi.me › blogs › api-guides › how-to-use-github-packages-api-to-manage-package-registries-in-python
How to Use GitHub Packages API to Manage Package Registries in Python – Omi AI
January 17, 2025 - The GitHub Packages API provides endpoints for interacting with these packages, allowing for tasks like publishing, consuming, and deleting packages programmatically.
🌐
GitHub
docs.github.com › en › enterprise-server@3.10 › rest › packages › packages
REST API endpoints for packages - GitHub Enterprise Server 3.10 Docs
For more information, see "About permissions for GitHub Packages." This endpoint works with the following fine-grained token types: ... The fine-grained token does not require any permissions. ... curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "http(s)://HOSTNAME/api/v3/orgs/ORG/packages?package_type=container"
🌐
GitHub
github.com › orgs › api-platform › packages
Packages · API Platform · GitHub
A default package manager used for the Java programming language and the Java runtime environment.
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 78730515 › github-packages-manage-access-to-package-from-actions-using-api
GitHub Packages: Manage access to package from Actions using API? - Stack Overflow
steps: - name: Checkout code uses: actions/checkout@v2 - name: Configure npm for GitHub Packages run: | echo "//npm.pkg.github.com/:_authToken=${{ secrets.PAT }}" > ~/.npmrc - name: Install Dependencies run: npm install ... Sign up to request clarification or add additional context in comments. ... You can not add repos to the package access list via API.
🌐
Josh-Ops
josh-ops.com › posts › github-download-from-github-packages
Programmatically Download a Package Binary from GitHub Packages | josh-ops
June 11, 2024 - With the GitHub Packages API, you can manage packages for your GitHub repositories and organizations.
🌐
GitHub
docs.github.com › en › enterprise-cloud@latest › packages › learn-github-packages › introduction-to-github-packages
Introduction to GitHub Packages - GitHub Enterprise Cloud Docs
You can integrate GitHub Packages with GitHub's APIs, GitHub Actions, and webhooks to create an end-to-end DevOps workflow that includes your code, CI, and deployment solutions.
🌐
GitHub
docs.github.com › en › rest
GitHub REST API documentation - GitHub Docs
Create integrations, retrieve data, and automate your workflows with the GitHub REST API.
🌐
GitHub
docs.github.com › en › packages › working-with-a-github-packages-registry › working-with-the-npm-registry
Working with the npm registry - GitHub Docs
You can use a personal access token (classic) to authenticate to GitHub Packages or the GitHub API. When you create a personal access token (classic), you can assign the token different scopes depending on your needs.
🌐
GitHub
docs.github.com › en › enterprise-server@3.10 › packages › learn-github-packages › introduction-to-github-packages
Introduction to GitHub Packages - GitHub Enterprise Server 3.10 Docs
You can integrate GitHub Packages with GitHub's APIs, GitHub Actions, and webhooks to create an end-to-end DevOps workflow that includes your code, CI, and deployment solutions.
🌐
GitHub
docs.github.com › en › packages
GitHub Packages documentation - GitHub Docs
GitHub Packages is a software package hosting service that allows you to host your software packages privately or publicly and use packages as dependencies in your projects.
🌐
GitHub
docs.github.com › en › packages › working-with-a-github-packages-registry › working-with-the-container-registry
Working with the Container registry - GitHub Docs
You can use a personal access token (classic) to authenticate to GitHub Packages or the GitHub API. When you create a personal access token (classic), you can assign the token different scopes depending on your needs.
🌐
Medium
medium.com › @IlyasKeser › list-all-versions-of-a-package-using-github-packages-api-5a1ed0b19d7e
List all versions of a package -using GitHub Packages API - Ilyas Keser - Medium
November 28, 2022 - curl \ -H “Accept: application/vnd.github+json” \ -H “Authorization: Bearer <your token>” \ https://api.github.com/orgs/<organisation>/packages/maven/<package>/versions
🌐
npm
npmjs.com › package › github-api
github-api - npm
January 25, 2021 - A higher-level wrapper around the Github API.. Latest version: 3.4.0, last published: 5 years ago. Start using github-api in your project by running `npm i github-api`. There are 182 other projects in the npm registry using github-api.
      » npm install github-api
    
Published   Jan 25, 2021
Version   3.4.0
🌐
GitHub
github.com › orgs › community › discussions › 45560
API access to GitHub container settings for action access · community · Discussion #45560
January 27, 2023 - Remember you could be rate limited by Github API. If you have 300 to do. Beta Was this translation helpful? Give feedback. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... @jge162 You seem to be talking about the solution, but it isn't in the documentation. If I try to hit · gh api -X POST /orgs/{org}/packages/container/{package_name}/settings/add_actions_access { "message": "Not Found", "documentation_url": "https://docs.github.com/enterprise-server@3.12/rest" } gh: Not Found (HTTP 404)
🌐
GitHub
docs.github.com › en › packages › working-with-a-github-packages-registry › working-with-the-nuget-registry
Working with the NuGet registry - GitHub Docs
Replace PROJECT_NAME with the name of the project, 1.0.0 with the version number of the package, and YOUR_GITHUB_PAT with your personal access token. dotnet nuget push "bin/Release/PROJECT_NAME.1.0.0.nupkg" --api-key YOUR_GITHUB_PAT --source "github"
🌐
GitHub
docs.github.com › en › packages › working-with-a-github-packages-registry › working-with-the-apache-maven-registry
Working with the Apache Maven registry - GitHub Docs
You can use a personal access token (classic) to authenticate to GitHub Packages or the GitHub API. When you create a personal access token (classic), you can assign the token different scopes depending on your needs.