View Source GitHub.Packages (GitHub REST API Client v0.1.1)
Provides API endpoints related to packages
Link to this section Summary
Functions
Delete a package for the authenticated user
Delete a package for an organization
Delete a package for a user
Delete a package version for the authenticated user
Delete package version for an organization
Delete package version for a user
List package versions for a package owned by the authenticated user
List package versions for a package owned by an organization
List package versions for a package owned by a user
Get a package for the authenticated user
Get a package for an organization
Get a package for a user
Get a package version for the authenticated user
Get a package version for an organization
Get a package version for a user
Get list of conflicting packages during Docker migration for authenticated-user
Get list of conflicting packages during Docker migration for organization
Get list of conflicting packages during Docker migration for user
List packages for the authenticated user's namespace
List packages for an organization
List packages for a user
Restore a package for the authenticated user
Restore a package for an organization
Restore a package for a user
Restore a package version for the authenticated user
Restore package version for an organization
Restore package version for a user
Link to this section Functions
delete_package_for_authenticated_user(package_type, package_name, opts \\ [])
View Source@spec delete_package_for_authenticated_user(String.t(), String.t(), keyword()) :: :ok | {:error, GitHub.Error.t()}
Delete a package for the authenticated user
Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must authenticate using an access token with the read:packages
and delete:packages
scopes.
If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
delete_package_for_org(package_type, package_name, org, opts \\ [])
View Source@spec delete_package_for_org(String.t(), String.t(), String.t(), keyword()) :: :ok | {:error, GitHub.Error.t()}
Delete a package for an organization
Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the read:packages
and delete:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to delete. For the list of these registries, see "About permissions for GitHub Packages."
resources
Resources
delete_package_for_user(package_type, package_name, username, opts \\ [])
View Source@spec delete_package_for_user(String.t(), String.t(), String.t(), keyword()) :: :ok | {:error, GitHub.Error.t()}
Delete a package for a user
Deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must authenticate using an access token with the read:packages
and delete:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to delete. For the list of these registries, see "About permissions for GitHub Packages."
resources
Resources
delete_package_version_for_authenticated_user(package_type, package_name, package_version_id, opts \\ [])
View Source@spec delete_package_version_for_authenticated_user( String.t(), String.t(), integer(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Delete a package version for the authenticated user
Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the read:packages
and delete:packages
scopes.
If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
delete_package_version_for_org(package_type, package_name, org, package_version_id, opts \\ [])
View Source@spec delete_package_version_for_org( String.t(), String.t(), String.t(), integer(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Delete package version for an organization
Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the read:packages
and delete:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to delete. For the list of these registries, see "About permissions for GitHub Packages."
resources
Resources
delete_package_version_for_user(package_type, package_name, username, package_version_id, opts \\ [])
View Source@spec delete_package_version_for_user( String.t(), String.t(), String.t(), integer(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Delete package version for a user
Deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must authenticate using an access token with the read:packages
and delete:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to delete. For the list of these registries, see "About permissions for GitHub Packages."
resources
Resources
get_all_package_versions_for_package_owned_by_authenticated_user(package_type, package_name, opts \\ [])
View Source@spec get_all_package_versions_for_package_owned_by_authenticated_user( String.t(), String.t(), keyword() ) :: {:ok, [GitHub.PackageVersion.t()]} | {:error, GitHub.Error.t()}
List package versions for a package owned by the authenticated user
Lists package versions for a package owned by the authenticated user.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
options
Options
page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).state
: The state of the package, either active or deleted.
resources
Resources
get_all_package_versions_for_package_owned_by_org(package_type, package_name, org, opts \\ [])
View Source@spec get_all_package_versions_for_package_owned_by_org( String.t(), String.t(), String.t(), keyword() ) :: {:ok, [GitHub.PackageVersion.t()]} | {:error, GitHub.Error.t()}
List package versions for a package owned by an organization
Lists package versions for a package owned by an organization.
If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
options
Options
page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).state
: The state of the package, either active or deleted.
resources
Resources
get_all_package_versions_for_package_owned_by_user(package_type, package_name, username, opts \\ [])
View Source@spec get_all_package_versions_for_package_owned_by_user( String.t(), String.t(), String.t(), keyword() ) :: {:ok, [GitHub.PackageVersion.t()]} | {:error, GitHub.Error.t()}
List package versions for a package owned by a user
Lists package versions for a public package owned by a specified user.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
get_package_for_authenticated_user(package_type, package_name, opts \\ [])
View Source@spec get_package_for_authenticated_user(String.t(), String.t(), keyword()) :: {:ok, GitHub.Package.t()} | {:error, GitHub.Error.t()}
Get a package for the authenticated user
Gets a specific package for a package owned by the authenticated user.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
get_package_for_organization(package_type, package_name, org, opts \\ [])
View Source@spec get_package_for_organization(String.t(), String.t(), String.t(), keyword()) :: {:ok, GitHub.Package.t()} | {:error, GitHub.Error.t()}
Get a package for an organization
Gets a specific package in an organization.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
get_package_for_user(package_type, package_name, username, opts \\ [])
View Source@spec get_package_for_user(String.t(), String.t(), String.t(), keyword()) :: {:ok, GitHub.Package.t()} | {:error, GitHub.Error.t()}
Get a package for a user
Gets a specific package metadata for a public package owned by a user.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
get_package_version_for_authenticated_user(package_type, package_name, package_version_id, opts \\ [])
View Source@spec get_package_version_for_authenticated_user( String.t(), String.t(), integer(), keyword() ) :: {:ok, GitHub.PackageVersion.t()} | {:error, GitHub.Error.t()}
Get a package version for the authenticated user
Gets a specific package version for a package owned by the authenticated user.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
get_package_version_for_organization(package_type, package_name, org, package_version_id, opts \\ [])
View Source@spec get_package_version_for_organization( String.t(), String.t(), String.t(), integer(), keyword() ) :: {:ok, GitHub.PackageVersion.t()} | {:error, GitHub.Error.t()}
Get a package version for an organization
Gets a specific package version in an organization.
You must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
get_package_version_for_user(package_type, package_name, package_version_id, username, opts \\ [])
View Source@spec get_package_version_for_user( String.t(), String.t(), integer(), String.t(), keyword() ) :: {:ok, GitHub.PackageVersion.t()} | {:error, GitHub.Error.t()}
Get a package version for a user
Gets a specific package version for a public package owned by a specified user.
At this time, to use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
list_docker_migration_conflicting_packages_for_authenticated_user(opts \\ [])
View Source@spec list_docker_migration_conflicting_packages_for_authenticated_user(keyword()) :: {:ok, [GitHub.Package.t()]} | {:error, GitHub.Error.t()}
Get list of conflicting packages during Docker migration for authenticated-user
Lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.
To use this endpoint, you must authenticate using an access token with the read:packages
scope.
resources
Resources
list_docker_migration_conflicting_packages_for_organization(org, opts \\ [])
View Source@spec list_docker_migration_conflicting_packages_for_organization( String.t(), keyword() ) :: {:ok, [GitHub.Package.t()]} | {:error, GitHub.Error.t()}
Get list of conflicting packages during Docker migration for organization
Lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.
To use this endpoint, you must authenticate using an access token with the read:packages
scope.
resources
Resources
list_docker_migration_conflicting_packages_for_user(username, opts \\ [])
View Source@spec list_docker_migration_conflicting_packages_for_user( String.t(), keyword() ) :: {:ok, [GitHub.Package.t()]} | {:error, GitHub.Error.t()}
Get list of conflicting packages during Docker migration for user
Lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.
To use this endpoint, you must authenticate using an access token with the read:packages
scope.
resources
Resources
@spec list_packages_for_authenticated_user(keyword()) :: {:ok, [GitHub.Package.t()]} | {:error, GitHub.Error.t()}
List packages for the authenticated user's namespace
Lists packages owned by the authenticated user within the user's namespace.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
options
Options
package_type
: The type of supported package. Packages in GitHub's Gradle registry have the typemaven
. Docker images pushed to GitHub's Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.visibility
: The selected visibility of the packages. This parameter is optional and only filters an existing result set.The
internal
visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystemsinternal
is synonymous withprivate
. For the list of GitHub Packages registries that support granular permissions, see "About permissions for GitHub Packages."page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).
resources
Resources
@spec list_packages_for_organization( String.t(), keyword() ) :: {:ok, [GitHub.Package.t()]} | {:error, GitHub.Error.t()}
List packages for an organization
Lists packages in an organization readable by the user.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
options
Options
package_type
: The type of supported package. Packages in GitHub's Gradle registry have the typemaven
. Docker images pushed to GitHub's Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.visibility
: The selected visibility of the packages. This parameter is optional and only filters an existing result set.The
internal
visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystemsinternal
is synonymous withprivate
. For the list of GitHub Packages registries that support granular permissions, see "About permissions for GitHub Packages."page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).
resources
Resources
@spec list_packages_for_user( String.t(), keyword() ) :: {:ok, [GitHub.Package.t()]} | {:error, GitHub.Error.t()}
List packages for a user
Lists all packages in a user's namespace for which the requesting user has access.
To use this endpoint, you must authenticate using an access token with the read:packages
scope. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
options
Options
package_type
: The type of supported package. Packages in GitHub's Gradle registry have the typemaven
. Docker images pushed to GitHub's Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.visibility
: The selected visibility of the packages. This parameter is optional and only filters an existing result set.The
internal
visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystemsinternal
is synonymous withprivate
. For the list of GitHub Packages registries that support granular permissions, see "About permissions for GitHub Packages."page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).
resources
Resources
restore_package_for_authenticated_user(package_type, package_name, opts \\ [])
View Source@spec restore_package_for_authenticated_user(String.t(), String.t(), keyword()) :: :ok | {:error, GitHub.Error.t()}
Restore a package for the authenticated user
Restores a package owned by the authenticated user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
To use this endpoint, you must authenticate using an access token with the read:packages
and write:packages
scopes. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
options
Options
token
: package token
resources
Resources
restore_package_for_org(package_type, package_name, org, opts \\ [])
View Source@spec restore_package_for_org(String.t(), String.t(), String.t(), keyword()) :: :ok | {:error, GitHub.Error.t()}
Restore a package for an organization
Restores an entire package in an organization.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the read:packages
and write:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to restore. For the list of these registries, see "About permissions for GitHub Packages."
options
Options
token
: package token
resources
Resources
restore_package_for_user(package_type, package_name, username, opts \\ [])
View Source@spec restore_package_for_user(String.t(), String.t(), String.t(), keyword()) :: :ok | {:error, GitHub.Error.t()}
Restore a package for a user
Restores an entire package for a user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
To use this endpoint, you must authenticate using an access token with the read:packages
and write:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to restore. For the list of these registries, see "About permissions for GitHub Packages."
options
Options
token
: package token
resources
Resources
restore_package_version_for_authenticated_user(package_type, package_name, package_version_id, opts \\ [])
View Source@spec restore_package_version_for_authenticated_user( String.t(), String.t(), integer(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Restore a package version for the authenticated user
Restores a package version owned by the authenticated user.
You can restore a deleted package version under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
To use this endpoint, you must authenticate using an access token with the read:packages
and write:packages
scopes. If the package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the repo
scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "About permissions for GitHub Packages."
resources
Resources
restore_package_version_for_org(package_type, package_name, org, package_version_id, opts \\ [])
View Source@spec restore_package_version_for_org( String.t(), String.t(), String.t(), integer(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Restore package version for an organization
Restores a specific package version in an organization.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the read:packages
and write:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to restore. For the list of these registries, see "About permissions for GitHub Packages."
resources
Resources
restore_package_version_for_user(package_type, package_name, username, package_version_id, opts \\ [])
View Source@spec restore_package_version_for_user( String.t(), String.t(), String.t(), integer(), keyword() ) :: :ok | {:error, GitHub.Error.t()}
Restore package version for a user
Restores a specific package version for a user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
To use this endpoint, you must authenticate using an access token with the read:packages
and write:packages
scopes. In addition:
- If the
package_type
belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include therepo
scope. For the list of these registries, see "About permissions for GitHub Packages." - If the
package_type
belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to restore. For the list of these registries, see "About permissions for GitHub Packages."