Permissions for packages
A package inherits the permissions and visibility of the repository that owns the package. You can find a package scoped to a repository by going to the main page of the repository and clicking the Packages link to the right of the page.
About scopes and permissions for package registries
To use or manage a package hosted by a package registry, you must use a personal access token with the appropriate scope, and your personal account must have appropriate permissions.
For example:
- To download and install packages from a repository, your personal access token must have the
read:packages
scope, and your user account must have read permission. - To delete a package on GitHub Enterprise Server, your personal access token must at least have the
delete:packages
andread:packages
scope. Therepo
scope is also required for repo-scoped packages. For more information, see "Deleting and restoring a package."
Scope | Description | Required permission |
---|---|---|
read:packages | Download and install packages from GitHub Packages | read |
write:packages | Upload and publish packages to GitHub Packages | write |
delete:packages | Delete packages from GitHub Packages | admin |
repo | Upload and delete packages (along with write:packages , or delete:packages ) | write or admin |
When you create a GitHub Actions workflow, you can use the GITHUB_TOKEN
to publish and install packages in GitHub Packages without needing to store and manage a personal access token.
For more information, see:
- "Publishing and installing a package with GitHub Actions"
- "Creating a personal access token"
- "Available scopes"
About repository transfers
You can transfer a repository to another user or organization account. For more information, see "Transferring a repository."
When you transfer a repository, GitHub transfers the packages associated with a repository as part of the repository transfer. All billable usage associated with the packages will subsequently be billed to the new owner. If the previous repository owner is removed as a collaborator on the repository, they may no longer be able to access the packages associated with the repository.
Maintaining access to packages in GitHub Actions workflows
To ensure your workflows will maintain access to your packages, ensure that you're using the right access token in your workflow and that you've enabled GitHub Actions access to your package.
For more conceptual background on GitHub Actions or examples of using packages in workflows, see "Managing GitHub Packages using GitHub Actions workflows."
Access tokens
- To publish packages associated with the workflow repository, use
GITHUB_TOKEN
. - To install packages associated with other private repositories that
GITHUB_TOKEN
can't access, use a personal access token
For more information about GITHUB_TOKEN
used in GitHub Actions workflows, see "Authentication in a workflow."