8000 Cannot retrive all package versions owned by the authenticated use · Issue #2251 · google/go-github · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Cannot retrive all package versions owned by the authenticated use #2251
Closed
@lpsm-dev

Description

@lpsm-dev

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)

Results

Screen Shot 2022-01-12 at 00 26 37

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking API ChangePR will require a bump to the major version num in next release. Look here to see the change(s).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0