Closed
Description
Problem
In the current implementation we cannot retrieve all versions of a package for a user
using the function PackageGetAllVersions
present in the users_packages.go
file.
The PackageGetAllVersions
function has no parameters to allow pagination and retrieve all versions of a package, being limited to a return of 30 elements []*PackageVersion
, which is the default value of the GitHub API.
Context
I'm creating a CLI tool to clean up my GitHub container packages and I find this limitation.
Code
// Getting all packages version
pkgVersions, _, err := client.Users.PackageGetAllVersions(ctx, name, "container", container)
if err != nil {
log.Fatal(err)
}
size := len(pkgVersions)
log.Infof("Package: %s", utils.DecodeParam(container))
log.Infof("We have %v versions in this package", size)