1
0
mirror of synced 2026-01-05 21:04:17 -05:00

repo sync

This commit is contained in:
Octomerger Bot
2021-02-18 11:26:50 +10:00
committed by GitHub
32 changed files with 9881 additions and 174 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -69,7 +69,7 @@ Name | Description
 `read:discussion` | Allows read access for team discussions.{% if currentVersion == "free-pro-team@latest" %}
**`write:packages`** | Grants access to upload or publish a package in {% data variables.product.prodname_registry %}. For more information, see "[Publishing a package](/github/managing-packages-with-github-packages/publishing-a-package)".
**`read:packages`** | Grants access to download or install packages from {% data variables.product.prodname_registry %}. For more information, see "[Installing a package](/github/managing-packages-with-github-packages/installing-a-package)".
**`delete:packages`** | Grants access to delete packages from {% data variables.product.prodname_registry %}. For more information, see "[Deleting packages](/github/managing-packages-with-github-packages/deleting-a-package)".{% endif %}
**`delete:packages`** | Grants access to delete packages from {% data variables.product.prodname_registry %}. For more information, see "[Deleting packages](/packages/learn-github-packages/deleting-and-restoring-a-package)".{% endif %}
**`admin:gpg_key`** | Fully manage GPG keys.
 `write:gpg_key`| Create, list, and view details for GPG keys.
 `read:gpg_key`| List and view details for GPG keys.{% if currentVersion == "free-pro-team@latest" %}

View File

@@ -90,7 +90,7 @@ In addition to managing organization-level settings, organization owners have ad
| Edit a repository's description | | | | **X** | **X** |{% if currentVersion == "free-pro-team@latest" %}
| [View and install packages](/packages/publishing-and-managing-packages) | **X** | **X** | **X** | **X** | **X** |
| [Publish packages](/packages/publishing-and-managing-packages/publishing-a-package) | | | **X** | **X** | **X** |
| [Delete packages](/packages/publishing-and-managing-packages/deleting-a-package) | | | | | **X** | {% endif %}
| [Delete packages](/packages/learn-github-packages/deleting-and-restoring-a-package) | | | | | **X** | {% endif %}
| Manage [topics](/articles/classifying-your-repository-with-topics) | | | | **X** | **X** |
| Enable wikis and restrict wiki editors | | | | **X** | **X** |
| Enable project boards | | | | **X** | **X** |
@@ -140,7 +140,7 @@ In this section, you can find the repository permission levels required for secu
| Receive [{% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies) in a repository | | | | | **X** |
| [Dismiss {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository) | | | | | **X** |
| [Designate additional people or teams to receive {% data variables.product.prodname_dependabot_alerts %}](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts) for vulnerable dependencies | | | | | **X** |
| Create [security advisories](/github/managing-security-vulnerabilities/about-github-security-advisories) | | | | | **X** |{% endif %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
| Create [security advisories](/github/managing-security-vulnerabilities/about-github-security-advisories) | | | | | **X** |{% endif %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
| Manage access to {% data variables.product.prodname_GH_advanced_security %} features (see "[Managing security and analysis settings for your organization](/github/setting-up-and-managing-organizations-and-teams/managing-security-and-analysis-settings-for-your-organization)") | | | | | **X** |{% endif %}{% if currentVersion == "free-pro-team@latest" %}
| [Enable the dependency graph](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-and-dependents-of-a-repository) for a private repository | | | | | **X** |
| [View dependency reviews](/github/collaborating-with-issues-and-pull-requests/reviewing-dependency-changes-in-a-pull-request) | **X** | **X** | **X** | **X** | **X** |{% endif %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}

View File

@@ -49,7 +49,8 @@ To search for specific events, use the `action` qualifier in your query. Actions
| [`org`](#org-category-actions) | Contains activities related to organization membership.{% if currentVersion == "free-pro-team@latest" %}
| [`org_credential_authorization`](#org_credential_authorization-category-actions) | Contains all activities related to authorizing credentials for use with SAML single sign-on.{% endif %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.19" or currentVersion == "github-ae@latest" %}
| [`organization_label`](#organization_label-category-actions) | Contains all activities related to default labels for repositories in your organization.{% endif %}
| [`oauth_application`](#oauth_application-category-actions) | Contains all activities related to OAuth Apps. {% if currentVersion == "free-pro-team@latest" %}
| [`oauth_application`](#oauth_application-category-actions) | Contains all activities related to OAuth Apps.{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}
| [`packages`](#packages-category-actions) | Contains all activities related to {% data variables.product.prodname_registry %}.{% endif %}{% if currentVersion == "free-pro-team@latest" %}
| [`payment_method`](#payment_method-category-actions) | Contains all activities related to how your organization pays for GitHub.{% endif %}
| [`profile_picture`](#profile_picture-category-actions) | Contains all activities related to your organization's profile picture.
| [`project`](#project-category-actions) | Contains all activities related to project boards.
@@ -127,7 +128,7 @@ To ensure a secure IP and maintain compliance for your organization, you can use
{% data reusables.audit_log.audit-log-api-info %}
{% if currentVersion == "free-pro-team@latest" %}
Note that you can't retrieve Git events using the GraphQL API. To retrieve Git events, use the REST API instead. For more information, see "[`git` category actions](#git-category-actions)."
Note that you can't retrieve Git events using the GraphQL API. To retrieve Git events, use the REST API instead. For more information, see "[`git` category actions](#git-category-actions)."
{% endif %}
The GraphQL response can include data for up to 90 to 120 days.
@@ -140,7 +141,7 @@ For example, you can make a GraphQL request to see all the new organization memb
{% note %}
**Note:** The audit log REST API is available as a public beta for users of {% data variables.product.prodname_ghe_cloud %} only.
**Note:** The audit log REST API is available as a public beta for users of {% data variables.product.prodname_ghe_cloud %} only.
{% endnote %}
@@ -249,7 +250,7 @@ An overview of some of the most common actions that are recorded as events in th
{% note %}
**Note:** To access Git events in the audit log, you must use the audit log REST API. This functionality is available as a public beta for users of {% data variables.product.prodname_ghe_cloud %} only.
**Note:** To access Git events in the audit log, you must use the audit log REST API. This functionality is available as a public beta for users of {% data variables.product.prodname_ghe_cloud %} only.
For more information about the audit log REST API, see "[Organizations](/rest/reference/orgs#get-the-audit-log-for-an-organization)" in the REST API documentation.
@@ -396,6 +397,19 @@ For more information, see "[Managing the publication of {% data variables.produc
| `revoke_tokens` | Triggered when an {% data variables.product.prodname_oauth_app %}'s user tokens are revoked.
| `transfer` | Triggered when an existing {% data variables.product.prodname_oauth_app %} is transferred to a new organization.
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}
#### `packages` category actions
| Action | Description |
|--------|-------------|
| `package_version_published` | Triggered when a package version is published. |
| `package_version_deleted` | Triggered when a specific package version is deleted. For more information, see "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)."
| `package_deleted` | Triggered when an entire package is deleted. For more information, see "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)."
| `package_version_restored` | Triggered when a specific package version is deleted. For more information, see "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)."
| `package_restored` | Triggered when an entire package is restored. For more information, see "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)."
{% endif %}
{% if currentVersion == "free-pro-team@latest" %}
#### `payment_method` category actions

View File

@@ -36,7 +36,7 @@ The repository owner has full control of the repository. In addition to the acti
| Manage the repository's topics | "[Classifying your repository with topics](/github/administering-a-repository/classifying-your-repository-with-topics)" |{% if currentVersion == "free-pro-team@latest" %}
| Manage security and analysis settings for the repository | "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %}
| Enable the dependency graph for a private repository | "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %}
| Delete packages | "[Deleting a package](/github/managing-packages-with-github-packages/deleting-a-package)" |{% endif %}
| Delete packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% endif %}
| Customize the repository's social media preview | "[Customizing your repository's social media preview](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" |
| Create a template from the repository | "[Creating a template repository](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %}
| Receive {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}{% data variables.product.prodname_dependabot_alerts %}{% else %}security alerts{% endif %} for vulnerable dependencies | "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %}

View File

@@ -2,7 +2,7 @@
title: About GitHub Container Registry
intro: 'You can use {% data variables.product.prodname_github_container_registry %} to seamlessly host and manage Docker container images in your organization or personal user account on {% data variables.product.prodname_dotcom %}. {% data variables.product.prodname_github_container_registry %} allows you to configure who can manage and access packages using fine-grained permissions.'
product: '{% data reusables.gated-features.packages %}'
redirect_from:
redirect_from:
- /packages/getting-started-with-github-container-registry/about-github-container-registry
- /packages/managing-container-images-with-github-container-registry
versions:
@@ -74,7 +74,7 @@ To use or manage a package hosted by a package registry, you must use a token wi
| --- | --- |
|`read:packages`| Download and install container images from {% data variables.product.prodname_github_container_registry %} |
|`write:packages`| Upload and publish container images to {% data variables.product.prodname_github_container_registry %} |
| `delete:packages` | Delete specified versions of private or public container images from {% data variables.product.prodname_github_container_registry %}. For more information, see "[Deleting a container image](/packages/guides/deleting-a-container-image)." |
| `delete:packages` | Delete specified versions of private or public container images from {% data variables.product.prodname_github_container_registry %}. For more information, see "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}." |
To learn about available scopes and permissions for container images, see "[Configuring access control and visibility for container images](/packages/guides/configuring-access-control-and-visibility-for-container-images)."

View File

@@ -190,4 +190,4 @@ To install an Apache Maven package from {% data variables.product.prodname_regis
### Further reading
- "[Configuring Gradle for use with {% data variables.product.prodname_registry %}](/packages/guides/configuring-gradle-for-use-with-github-packages)"
- "[Deleting a package](/packages/manage-packages/deleting-a-package/)"
- "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}."

View File

@@ -266,4 +266,4 @@ $ docker pull <em>HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:TAG_NAME</em>
### Further reading
- "[Deleting a package](/packages/publishing-and-managing-packages/deleting-a-package/)"
- "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}."

View File

@@ -220,4 +220,4 @@ Using packages from {% data variables.product.prodname_dotcom %} in your project
### Further reading
- "[Deleting a package](/packages/publishing-and-managing-packages/deleting-a-package/)"
- "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}."

View File

@@ -147,22 +147,22 @@ subprojects {
}
}
```
#### Authenticating with the `GITHUB_TOKEN`
{% data reusables.package_registry.package-registry-with-github-tokens %}
For more information about using `GITHUB_TOKEN` with Maven, see "[Publishing Java packages with Maven](/actions/language-and-framework-guides/publishing-java-packages-with-maven#publishing-packages-to-github-packages)."
### Publishing a package
{% data reusables.package_registry.default-name %} For example, {% data variables.product.prodname_dotcom %} will publish a package named `com.example.test` in the `OWNER/test` {% data variables.product.prodname_registry %} repository.
{% data reusables.package_registry.viewing-packages %}
{% data reusables.package_registry.authenticate-step %}
2. After creating your package, you can publish the package.
```shell
$ gradle publish
```
@@ -201,9 +201,9 @@ You can install a package by adding the package as a dependency to your project.
`maven`
}
```
3. Install the package.
```shell
$ gradle install
```
@@ -211,4 +211,4 @@ You can install a package by adding the package as a dependency to your project.
### Further reading
- "[Configuring Apache Maven for use with {% data variables.product.prodname_registry %}](/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages)"
- "[Deleting a package](/packages/publishing-and-managing-packages/deleting-a-package/)"
- "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}."

View File

@@ -23,7 +23,7 @@ If you publish over 1,000 npm package versions to {% data variables.product.prod
In the future, to improve performance of the service, you won't be able to publish more than 1,000 versions of a package on {% data variables.product.prodname_dotcom %}. Any versions published before hitting this limit will still be readable.
If you reach this limit, consider deleting package versions or contact Support for help. When this limit is enforced, our documentation will be updated with a way to work around this limit. For more information, see "[Deleting a package](/packages/manage-packages/deleting-a-package)" or "[Contacting Support](/packages/learn-github-packages/about-github-packages#contacting-support)."
If you reach this limit, consider deleting package versions or contact Support for help. When this limit is enforced, our documentation will be updated with a way to work around this limit. For more information, see "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}" or "[Contacting Support](/packages/learn-github-packages/about-github-packages#contacting-support)."
{% endif %}
@@ -213,4 +213,4 @@ registry=https://<em>HOSTNAME</em>/_registry/npm/<em>OWNER</em>
### Further reading
- "[Deleting a package](/packages/publishing-and-managing-packages/deleting-a-package/)"
- "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}."

View File

@@ -23,46 +23,46 @@ versions:
```shell
$ gem --version
```
- You must have bundler 1.6.4 or higher. To find your Bundler version:
```shell
$ bundle --version
Bundler version 1.13.7
```
- Install keycutter to manage multiple credentials. To install keycutter:
```shell
$ gem install keycutter
```
### Authenticating to {% data variables.product.prodname_registry %}
{% data reusables.package_registry.authenticate-packages %}
#### Authenticating with a personal access token
{% data reusables.package_registry.required-scopes %}
You can authenticate to {% data variables.product.prodname_registry %} with RubyGems by editing the *~/.gem/credentials* file for publishing gems, editing the *~/.gemrc* file for installing a single gem, or using Bundler for tracking and installing one or more gems.
To publish new gems, you need to authenticate to {% data variables.product.prodname_registry %} with RubyGems by editing your *~/.gem/credentials* file to include your personal access token. Create a new *~/.gem/credentials* file if this file doesn't exist.
For example, you would create or edit a *~/.gem/credentials* to include the following, replacing *TOKEN* with your personal access token.
```shell
---
:github: Bearer <em>TOKEN</em>
```
To install gems, you need to authenticate to {% data variables.product.prodname_registry %} by editing the *~/.gemrc* file for your project to include `https://USERNAME:TOKEN@{% if currentVersion == "free-pro-team@latest" %}rubygems.pkg.github.com{% else %}REGISTRY-URL{% endif %}/OWNER/`. You must replace:
- `USERNAME` with your {% data variables.product.prodname_dotcom %} username.
- `TOKEN` with your personal access token.
- `OWNER` with the name of the user or organization account that owns the repository containing your project.{% if enterpriseServerVersions contains currentVersion %}
- `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the hostname of your {% data variables.product.prodname_ghe_server %} instance.
{% endif %}
{% endif %}
If you don't have a *~/.gemrc* file, create a new *~/.gemrc* file using this example.
```shell
---
:backtrace: false
@@ -74,29 +74,29 @@ If you don't have a *~/.gemrc* file, create a new *~/.gemrc* file using this exa
:verbose: true
```
To authenticate with Bundler, configure Bundler to use your personal access token, replacing *USERNAME* with your {% data variables.product.prodname_dotcom %} username, *TOKEN* with your personal access token, and *OWNER* with the name of the user or organization account that owns the repository containing your project.{% if enterpriseServerVersions contains currentVersion %} Replace `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the hostname of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
To authenticate with Bundler, configure Bundler to use your personal access token, replacing *USERNAME* with your {% data variables.product.prodname_dotcom %} username, *TOKEN* with your personal access token, and *OWNER* with the name of the user or organization account that owns the repository containing your project.{% if enterpriseServerVersions contains currentVersion %} Replace `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the hostname of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
```shell
$ bundle config https://{% if currentVersion == "free-pro-team@latest" %}rubygems.pkg.github.com{% else %}REGISTRY-URL{% endif %}/<em>OWNER USERNAME:TOKEN</em>
```
#### Authenticating with the `GITHUB_TOKEN`
{% data reusables.package_registry.package-registry-with-github-tokens %}
### Publishing a package
{% data reusables.package_registry.default-name %} For example, when you publish `octo-gem` to the `octo-org` organization, {% data variables.product.prodname_registry %} publishes the gem to the `octo-org/octo-gem` repository. For more information on creating your gem, see "[Make your own gem](http://guides.rubygems.org/make-your-own-gem/)" in the RubyGems documentation.
{% data reusables.package_registry.viewing-packages %}
{% data reusables.package_registry.authenticate-step %}
2. Build the package from the *gemspec* to create the *.gem* package.
```shell
gem build OCTO-GEM.gemspec
```
3. Publish a package to {% data variables.product.prodname_registry %}, replacing `OWNER` with the name of the user or organization account that owns the repository containing your project and `OCTO-GEM` with the name of your gem package.{% if enterpriseServerVersions contains currentVersion %} Replace `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
3. Publish a package to {% data variables.product.prodname_registry %}, replacing `OWNER` with the name of the user or organization account that owns the repository containing your project and `OCTO-GEM` with the name of your gem package.{% if enterpriseServerVersions contains currentVersion %} Replace `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
```shell
$ gem push --key github \
@@ -106,7 +106,7 @@ $ bundle config https://{% if currentVersion == "free-pro-team@latest" %}rubygem
### Publishing multiple packages to the same repository
To publish multiple gems to the same repository, you can include the URL to the {% data variables.product.prodname_dotcom %} repository in the `github_repo` field in `gem.metadata`. If you include this field, {% data variables.product.prodname_dotcom %} matches the repository based on this value, instead of using the gem name.{% if enterpriseServerVersions contains currentVersion %} Replace *HOSTNAME* with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
To publish multiple gems to the same repository, you can include the URL to the {% data variables.product.prodname_dotcom %} repository in the `github_repo` field in `gem.metadata`. If you include this field, {% data variables.product.prodname_dotcom %} matches the repository based on this value, instead of using the gem name.{% if enterpriseServerVersions contains currentVersion %} Replace *HOSTNAME* with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
```ruby
gem.metadata = { "github_repo" => "ssh://{% if currentVersion == "free-pro-team@latest" %}github.com{% else %}HOSTNAME{% endif %}/OWNER/REPOSITORY" }
@@ -117,7 +117,7 @@ gem.metadata = { "github_repo" => "ssh://{% if currentVersion == "free-pro-team@
You can use gems from {% data variables.product.prodname_registry %} much like you use gems from *rubygems.org*. You need to authenticate to {% data variables.product.prodname_registry %} by adding your {% data variables.product.prodname_dotcom %} user or organization as a source in the *~/.gemrc* file or by using Bundler and editing you *Gemfile*.
{% data reusables.package_registry.authenticate-step %}
2. For Bundler, add your {% data variables.product.prodname_dotcom %} user or organization as a source in your *Gemfile* to fetch gems from this new source. For example, you can add a new `source` block to your *Gemfile* that uses {% data variables.product.prodname_registry %} only for the packages you specify, replacing *GEM NAME* with the package you want to install from {% data variables.product.prodname_registry %} and *OWNER* with the user or organization that owns the repository containing the gem you want to install.{% if enterpriseServerVersions contains currentVersion %} Replace `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
2. For Bundler, add your {% data variables.product.prodname_dotcom %} user or organization as a source in your *Gemfile* to fetch gems from this new source. For example, you can add a new `source` block to your *Gemfile* that uses {% data variables.product.prodname_registry %} only for the packages you specify, replacing *GEM NAME* with the package you want to install from {% data variables.product.prodname_registry %} and *OWNER* with the user or organization that owns the repository containing the gem you want to install.{% if enterpriseServerVersions contains currentVersion %} Replace `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% endif %}
```ruby
source "https://rubygems.org"
@@ -146,4 +146,4 @@ You can use gems from {% data variables.product.prodname_registry %} much like y
### Further reading
- "[Deleting a package](/packages/publishing-and-managing-packages/deleting-a-package/)"
- "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.0" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}."

View File

@@ -1,65 +0,0 @@
---
title: Deleting a container image
intro: 'You can delete a specific version or all versions of a private or public container image on {% data variables.product.prodname_dotcom %}.'
product: '{% data reusables.gated-features.packages %}'
redirect_from:
- /packages/managing-container-images-with-github-container-registry/deleting-a-container-image
versions:
free-pro-team: '*'
---
{% data reusables.package_registry.container-registry-beta %}
### About package deletion
You can remove an entire container image or a specific version on {% data variables.product.prodname_dotcom %}. To delete a container image, you must use the UI. Using GraphQL to delete a container image is not supported at this time.
To delete a container image, you must have admin permissions to the container image.
When deleting public packages, be aware that you may break projects that depend on your package.
### Deleting a version of a user-owned container image on {% data variables.product.prodname_dotcom %}
To only delete specific versions of a container image, you can use these steps. To delete an entire package, see "[Deleting all versions of a user-owned container image on {% data variables.product.prodname_dotcom %}](#deleting-all-versions-of-a-user-owned-container-image-on-github)."
{% data reusables.package_registry.package-settings-from-user-level %}
5. On the left, click **Manage versions**.
6. Optionally, to ensure you're seeing all of your package versions, use the "Type" drop down menu and select **All**.
![Package version type drop down menu showing option to list all versions](/assets/images/help/package-registry/make-all-container-versions-visible.png)
5. To the right of the version you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} and select **Delete version**.
![Delete package version button](/assets/images/help/package-registry/delete-container-package-version.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this version**.
![Confirm package deletion button](/assets/images/help/package-registry/confirm-container-package-version-deletion.png)
### Deleting a version of an organization-owned container image on {% data variables.product.prodname_dotcom %}
To only delete specific versions of a container image that you have admin , you can use these steps. To delete an entire package, see "[Deleting all versions of an organization-owned container image on {% data variables.product.prodname_dotcom %}](#deleting-all-versions-of-an-organization-owned-container-image-on-github)."
{% data reusables.package_registry.package-settings-from-org-level %}
5. On the left, click **Manage versions**.
6. Optionally, to ensure you're seeing all of your package versions, use the "Type" drop down menu and select **All**.
![Package version type drop down menu showing option to list all versions](/assets/images/help/package-registry/make-all-container-versions-visible.png)
5. To the right of the version you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} and select **Delete version**.
![Delete package version button](/assets/images/help/package-registry/delete-container-package-version.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this version**.
![Confirm package version deletion button](/assets/images/help/package-registry/confirm-container-package-version-deletion.png)
### Deleting all versions of a user-owned container image on {% data variables.product.prodname_dotcom %}
{% data reusables.package_registry.package-settings-from-user-level %}
5. On the left, click **Options**.
!["Options" menu option](/assets/images/help/package-registry/options-for-container-settings.png)
6. Under "Danger zone", click **Delete this package**.
![Delete package version button](/assets/images/help/package-registry/delete-container-package-button.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this package**.
![Confirm package version deletion button](/assets/images/help/package-registry/confirm-container-package-deletion.png)
### Deleting all versions of an organization-owned container image on {% data variables.product.prodname_dotcom %}
{% data reusables.package_registry.package-settings-from-org-level %}
5. On the left, click **Options**.
!["Options" menu option](/assets/images/help/package-registry/options-for-container-settings.png)
6. Under "Danger zone", click **Delete this package**.
![Delete package button](/assets/images/help/package-registry/delete-container-package-button.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this package**.
![Confirm package deletion button](/assets/images/help/package-registry/confirm-container-package-deletion.png)

View File

@@ -29,5 +29,3 @@ versions:
{% link_in_list /configuring-access-control-and-visibility-for-container-images %}
{% link_in_list /connecting-a-repository-to-a-container-image %}
{% link_in_list /pushing-and-pulling-docker-images %}
{% link_in_list /deleting-a-container-image %}

View File

@@ -134,13 +134,13 @@ To use or manage a package hosted by a package registry, you must use a token wi
For example:
- To download and install packages from a repository, your token must have the `read:packages` scope, and your user account must have read permissions for the repository.
- To delete a specified version of a private package on {% data variables.product.product_name %}, your token must have the `delete:packages` and `repo` scope. Public packages cannot be deleted. For more information, see "[Deleting a package](/packages/manage-packages/deleting-a-package)."
- {% if currentVersion == "free-pro-team@latest" or if currentVersion ver_gt "enterprise-server@3.0" %}To delete a package on {% data variables.product.product_name %}, your token must at least have the `delete:packages` and `read:packages` scope. The `repo` scope is also required for repo-scoped packages.{% endif %}{% if currentVersion ver_lt "enterprise-server@3.1" %}To delete a specified version of a private package on {% data variables.product.product_name %}, your token must have the `delete:packages` and `repo` scope. Public packages cannot be deleted.{% endif %} For more information, see "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.1" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}."
| Scope | Description | Repository permissions |
| --- | --- | --- |
|`read:packages`| Download and install packages from {% data variables.product.prodname_registry %} | read |
|`write:packages`| Upload and publish packages to {% data variables.product.prodname_registry %} | write |
| `delete:packages` | Delete specified versions of private packages from {% data variables.product.prodname_registry %} | admin |
| `delete:packages` | {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} Delete packages from {% data variables.product.prodname_registry %} {% endif %}{% if currentVersion ver_lt "enterprise-server@3.1" %} Delete specified versions of private packages from {% data variables.product.prodname_registry %} {% endif %} | admin |
| `repo` | Upload and delete packages (along with `write:packages`, or `delete:packages`) | write, or admin |
When you create a {% data variables.product.prodname_actions %} workflow, you can use the `GITHUB_TOKEN` to publish and install packages in {% data variables.product.prodname_registry %} without needing to store and manage a personal access token.
@@ -152,7 +152,19 @@ For more information, see:
### Managing packages
You can delete a version of a private package in the {% data variables.product.product_name %} user interface or using the GraphQL API. When you use the GraphQL API to query and delete private packages, you must use the same token you use to authenticate to {% data variables.product.prodname_registry %}. For more information, see "[Deleting a package](/packages/manage-packages/deleting-a-package)" and "[Forming calls with GraphQL](/graphql/guides/forming-calls-with-graphql)."
{% if currentVersion == "free-pro-team@latest" %}
You can delete a package in the {% data variables.product.product_name %} user interface or using the REST API. For more information, see the "[{% data variables.product.prodname_registry %} API](/rest/reference/packages)."
{% endif %}
{% if currentVersion ver_gt "enterprise-server@3.0" %}
You can delete a private or public package in the {% data variables.product.product_name %} user interface. Or for repo-scoped packages, you can delete a version of a private package using GraphQL.
{% endif %}
{% if currentVersion ver_lt "enterprise-server@3.1" %}
You can delete a version of a private package in the {% data variables.product.product_name %} user interface or using the GraphQL API.
{% endif %}
When you use the GraphQL API to query and delete private packages, you must use the same token you use to authenticate to {% data variables.product.prodname_registry %}. For more information, see "{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package){% elsif currentVersion ver_lt "enterprise-server@3.1" %}[Deleting a package](/packages/learn-github-packages/deleting-a-package){% endif %}" and "[Forming calls with GraphQL](/graphql/guides/forming-calls-with-graphql)."
You can configure webhooks to subscribe to package-related events, such as when a package is published or updated. For more information, see the "[`package` webhook event](/webhooks/event-payloads/#package)."

View File

@@ -2,39 +2,15 @@
title: Deleting a package
intro: 'You can delete a version of a private package using GraphQL or on {% data variables.product.product_name %}.'
product: '{% data reusables.gated-features.packages %}'
redirect_from:
- /github/managing-packages-with-github-packages/deleting-a-package
- /packages/publishing-and-managing-packages/deleting-a-package
versions:
free-pro-team: '*'
enterprise-server: '>=2.22'
enterprise-server: '>=2.22 <3.1'
---
{% data reusables.package_registry.packages-ghes-release-stage %}
{% if currentVersion == "free-pro-team@latest" %}
### About container image deletion
To delete a container image package on {% data variables.product.product_name %}, see "[Deleting a container image](/packages/guides/deleting-a-container-image)."
{% endif %}
### About private package deletion
You can only delete a specified version of a private package on {% data variables.product.product_name %} or with the GraphQL API. To remove an entire private package from appearing on {% data variables.product.product_name %}, you must delete every version of the package first.
{% if currentVersion == "free-pro-team@latest" %}
### About public package deletion
To avoid breaking projects that may depend on your packages, you cannot delete an entire public package or specific versions of a public package.
Under special circumstances, such as for legal reasons or to conform with GDPR standards, you can ask {% data variables.contact.github_support %} to delete a public package for you, using [our contact form](https://github.com/contact?form%5Bsubject%5D=Re:%20GitHub%20Package%20Registry).
{% else %}
At this time, {% data variables.product.prodname_registry %} on {% data variables.product.product_location %} does not support deleting public packages.
{% endif %}
You can only delete a specified version of a private package on {% data variables.product.product_name %} or with the GraphQL API. To remove an entire private package from appearing on {% data variables.product.product_name %}, you must delete every version of the package first.
### Deleting a version of a private package on {% data variables.product.product_name %}
@@ -57,17 +33,6 @@ Use the `deletePackageVersion` mutation in the GraphQL API. You must use a token
Here is an example cURL command to delete a package version with the package version ID of `MDIyOlJlZ2lzdHJ5UGFja2FnZVZlcnNpb243MTExNg`, using a personal access token.
{% if currentVersion == "free-pro-team@latest" %}
```shell
curl -X POST \
-H "Accept: application/vnd.github.package-deletes-preview+json" \
-H "Authorization: bearer TOKEN" \
-d '{"query":"mutation { deletePackageVersion(input:{packageVersionId:\"MDIyOlJlZ2lzdHJ5UGFja2FnZVZlcnNpb243MTExNg==\"}) { success }}"}' \
https://api.github.com/graphql
```
{% else %}
```shell
curl -X POST \
-H "Accept: application/vnd.github.package-deletes-preview+json" \
@@ -76,10 +41,8 @@ curl -X POST \
HOSTNAME/graphql
```
{% endif %}
To find all of the private packages you have published to {% data variables.product.prodname_registry %}, along with the version IDs for the packages, you can use the `packages` connection through the `repository` object. You will need a token with the `read:packages` and `repo` scopes. For more information, see the [`packages`](/graphql/reference/objects#repository) connection or the [`PackageOwner`](/graphql/reference/interfaces#packageowner) interface.
For more information about the `deletePackageVersion` mutation, see "[`deletePackageVersion`](/graphql/reference/mutations#deletepackageversion)."
You cannot delete an entire package, but if you delete every version of a package, the package will no longer show on {% data variables.product.product_name %}
You cannot delete an entire package, but if you delete every version of a package, the package will no longer show on {% data variables.product.product_name %}.

View File

@@ -0,0 +1,249 @@
---
title: Deleting and restoring a package
intro: 'Learn how to delete or restore a package.'
product: '{% data reusables.gated-features.packages %}'
redirect_from:
- /github/managing-packages-with-github-packages/deleting-a-package
- /packages/publishing-and-managing-packages/deleting-a-package
- /packages/manage-packages/deleting-a-package
- /packages/guides/deleting-a-container-image
versions:
free-pro-team: '*'
enterprise-server: '>=3.1'
---
{% data reusables.package_registry.packages-ghes-release-stage %}
## Package deletion and restoration support on {% data variables.product.prodname_dotcom %}
On {% data variables.product.prodname_dotcom %} if you have the required access, you can delete:
- an entire private package
- an entire public package, if there's not more than 25 downloads of any version of the package
- a specific version of a private package
- a specific version of a public package, if the package version doesn't have more than 25 downloads
{% note %}
**Note:**
- You cannot delete a public package if any version of the package has more than 25 downloads. In this scenario, contact [GitHub support](https://support.github.com/contact) for further assistance.
- When deleting public packages, be aware that you may break projects that depend on your package.
{% endnote %}
On {% data variables.product.prodname_dotcom %}, you can also restore an entire package or package version, if:
- You restore the package within 30 days of its deletion.
- The same package namespace is still available and not used for a new package.
## Packages API support
{% if currentVersion == "free-pro-team@latest" %}
You can use the REST API to manage your packages. For more information, see the "[{% data variables.product.prodname_registry %} API](/rest/reference/packages)."
{% endif %}
For packages that inherit their permissions and access from repositories, you can use GraphQL to delete a specific package version.{% if currentVersion == "free-pro-team@latest" %} The {% data variables.product.prodname_registry %} GraphQL API does not support containers or Docker images that use the package namespace `https://ghcr.io/OWNER/PACKAGE-NAME`. For more information about GraphQL support, see "[Deleting a version of a repository-scoped package with GraphQL](#deleting-a-version-of-a-repository-scoped-package-with-graphql)."
{% data reusables.package_registry.container-registry-beta %}
{% endif %}
## Required permissions to delete or restore a package
For packages that inherit their access permissions from repositories, you can delete a package if you have admin permissions to the repository.
Repository-scoped packages on {% data variables.product.prodname_registry %} include these packages:
- npm
- RubyGems
- maven
- Gradle
- NuGet
- Docker images at `docker.pkg.github.com/OWNER/REPOSITORY/IMAGE-NAME`
{% if currentVersion == "free-pro-team@latest" %}
To delete a package that has granular permissions separate from a repository, such as containers or Docker images stored at `https://ghcr.io/OWNER/PACKAGE-NAME`, you must have admin access to the package.
<!--PLACEHOLDER - once packages restructuring is done this is a good place to link to the access control and visibility article.-->
{% data reusables.package_registry.container-registry-beta %}
{% endif %}
## Automate package version deletion with {% data variables.product.prodname_actions %}
You can automate package version deletion using an official action created by {% data variables.product.company_short %}. This action is available in the actions repository or on {% data variables.product.prodname_marketplace %} and only works with repository-scoped packages. For more information, see the "Delete Package Versions" action on [{% data variables.product.prodname_marketplace %}](https://github.com/marketplace/actions/delete-package-versions) or in the [actions repository](https://github.com/actions/delete-package-versions).
## Deleting a package version
### Deleting a version of a repository-scoped package on {% data variables.product.prodname_dotcom %}
To delete a version of a repository-scoped package, you must have admin permissions to the repository that owns the package. For more information, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.package_registry.packages-from-code-tab %}
{% data reusables.package_registry.package-settings-option %}
5. On the left, click **Manage versions**.
5. To the right of the version you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} and select **Delete version**.
![Delete package version button](/assets/images/help/package-registry/delete-container-package-version.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this version**.
![Confirm package deletion button](/assets/images/help/package-registry/package-version-deletion-confirmation.png)
### Deleting a version of a repository-scoped package with GraphQL
For packages that inherit their permissions and access from repositories, you can use the GraphQL to delete a specific package version.
{% if currentVersion == "free-pro-team@latest" %}
GraphQL is not supported for containers or Docker images at `ghcr.io`.
{% endif %}
<!--PLACEHOLDER for when API link is live: For full support, use the REST API. For more information, see the "[{% data variables.product.prodname_registry %} API](/rest/reference/packages)." -->
Use the `deletePackageVersion` mutation in the GraphQL API. You must use a token with the `read:packages`, `delete:packages`, and `repo` scopes. For more information about tokens, see "[About {% data variables.product.prodname_registry %}](/packages/publishing-and-managing-packages/about-github-packages#authenticating-to-github-packages)."
The following example demonstrates how to delete a package version, using a `packageVersionId` of `MDIyOlJlZ2lzdHJ5UGFja2FnZVZlcnNpb243MTExNg`.
```shell
curl -X POST \
-H "Accept: application/vnd.github.package-deletes-preview+json" \
-H "Authorization: bearer TOKEN" \
-d '{"query":"mutation { deletePackageVersion(input:{packageVersionId:\"MDIyOlJlZ2lzdHJ5UGFja2FnZVZlcnNpb243MTExNg==\"}) { success }}"}' \
HOSTNAME/graphql
```
To find all of the private packages you have published to {% data variables.product.prodname_registry %}, along with the version IDs for the packages, you can use the `packages` connection through the `repository` object. You will need a token with the `read:packages` and `repo` scopes. For more information, see the [`packages`](/graphql/reference/objects#repository) connection or the [`PackageOwner`](/graphql/reference/interfaces#packageowner) interface.
For more information about the `deletePackageVersion` mutation, see "[`deletePackageVersion`](/graphql/reference/mutations#deletepackageversion)."
You cannot directly delete an entire package using GraphQL, but if you delete every version of a package, the package will no longer show on {% data variables.product.product_name %}.
{% if currentVersion == "free-pro-team@latest" %}
### Deleting a version of a user-scoped package on {% data variables.product.prodname_dotcom %}
To delete a specific version of a user-scoped package on {% data variables.product.prodname_dotcom %}, such as for a Docker image at `ghcr.io`, use these steps. To delete an entire package, see "[Deleting an entire user-scoped package on {% data variables.product.prodname_dotcom %}](#deleting-an-entire-user-scoped-package-on-github)."
{% data reusables.package_registry.container-registry-beta %}
To review who can delete a package version, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.package_registry.package-settings-from-user-level %}
{% data reusables.package_registry.package-settings-option %}
5. On the left, click **Manage versions**.
5. To the right of the version you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} and select **Delete version**.
![Delete package version button](/assets/images/help/package-registry/delete-container-package-version.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this version**.
![Confirm package deletion button](/assets/images/help/package-registry/confirm-container-package-version-deletion.png)
### Deleting a version of an organization-scoped package on GitHub
To delete a specific version of an organization-scoped package on {% data variables.product.prodname_dotcom %}, such as for a Docker image at `ghcr.io`, use these steps.
To delete an entire package, see "[Deleting an entire organization-scoped package on {% data variables.product.prodname_dotcom %}](#deleting-an-entire-organization-scoped-package-on-github)."
{% data reusables.package_registry.container-registry-beta %}
To review who can delete a package version, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.package_registry.package-settings-from-org-level %}
{% data reusables.package_registry.package-settings-option %}
5. On the left, click **Manage versions**.
5. To the right of the version you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} and select **Delete version**.
![Delete package version button](/assets/images/help/package-registry/delete-container-package-version.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this version**.
![Confirm package version deletion button](/assets/images/help/package-registry/confirm-container-package-version-deletion.png)
{% endif %}
## Deleting an entire package
### Deleting an entire repository-scoped package on {% data variables.product.prodname_dotcom %}
To delete an entire repository-scoped package, you must have admin permissions to the repository that owns the package. For more information, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.package_registry.packages-from-code-tab %}
{% data reusables.package_registry.package-settings-option %}
4. Under "Danger Zone", click **Delete this package**.
5. To confirm, review the confirmation message, enter your package name, and click **I understand, delete this package.**
![Confirm package deletion button](/assets/images/help/package-registry/package-version-deletion-confirmation.png)
{% if currentVersion == "free-pro-team@latest" %}
### Deleting an entire user-scoped package on {% data variables.product.prodname_dotcom %}
To review who can delete a package, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.package_registry.package-settings-from-user-level %}
{% data reusables.package_registry.package-settings-option %}
5. On the left, click **Options**.
!["Options" menu option](/assets/images/help/package-registry/options-for-container-settings.png)
6. Under "Danger zone", click **Delete this package**.
![Delete package version button](/assets/images/help/package-registry/delete-container-package-button.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this package**.
![Confirm package version deletion button](/assets/images/help/package-registry/confirm-container-package-deletion.png)
### Deleting an entire organization-scoped package on {% data variables.product.prodname_dotcom %}
To review who can delete a package, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.package_registry.package-settings-from-org-level %}
{% data reusables.package_registry.package-settings-option %}
5. On the left, click **Options**.
!["Options" menu option](/assets/images/help/package-registry/options-for-container-settings.png)
6. Under "Danger zone", click **Delete this package**.
![Delete package button](/assets/images/help/package-registry/delete-container-package-button.png)
6. To confirm deletion, type the package name and click **I understand the consequences, delete this package**.
![Confirm package deletion button](/assets/images/help/package-registry/confirm-container-package-deletion.png)
{% endif %}
## Restoring packages
You can restore a deleted package or version if:
- You restore the package within 30 days of its deletion.
- The same package namespace and version is still available and not reused for a new package.
For example, if you have a deleted rubygem package named `octo-package` that was scoped to the repo `octo-repo-owner/octo-repo`, then you can only restore the package if the package namespace `rubygem.pkg.github.com/octo-repo-owner/octo-repo/octo-package` is still available, and 30 days have not yet passed.
You must also meet one of these permission requirements:
- For repository-scoped packages: You have admin permissions to the repository that owns the deleted package.
- For user-account scoped packages: Your user account owns the deleted package.
- For organization-scoped packages: You have admin permissions to the deleted package in the organization that owns the package.
For more information, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
Once the package is restored, the package will use the same namespace it did before. 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.
### Restoring a package in an organization
You can restore a deleted package through your organization account settings, as long as the package was in one of your repositories or had granular permissions and was scoped to your organization account.
To review who can restore a package in an organization, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.organizations.navigate-to-org %}
{% data reusables.organizations.org_settings %}
3. On the left, click **Packages**.
4. Under "Deleted Packages", next to the package you want to restore, click **Restore**.
![Restore button](/assets/images/help/package-registry/restore-option-for-deleted-package-in-an-org.png)
5. To confirm, type the name of the package and click **I understand the consequences, restore this package**.
![Restore package confirmation button](/assets/images/help/package-registry/type-package-name-and-restore-button.png)
### Restoring a user-account scoped package
You can restore a deleted package through your user account settings, if the package was in one of your repositories or scoped to your user account. For more information, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
{% data reusables.user_settings.access_settings %}
2. On the left, click **Packages**.
4. Under "Deleted Packages", next to the package you want to restore, click **Restore**.
![Restore button](/assets/images/help/package-registry/restore-option-for-deleted-package-in-an-org.png)
5. To confirm, type the name of the package and click **I understand the consequences, restore this package**.
![Restore package confirmation button](/assets/images/help/package-registry/type-package-name-and-restore-button.png)
### Restoring a package version
You can restore a package version from your package's landing page. To review who can restore a package, see "[Required permissions](#required-permissions-to-delete-or-restore-a-package)."
1. Navigate to your package's landing page.
2. On the right, click **Package settings**.
2. On the left, click **Manage versions**.
3. On the top right, use the "Versions" drop-down menu and select **Deleted**.
![Versions drop-down menu showing the deleted option](/assets/images/help/package-registry/versions-drop-down-menu.png)
4. Next to the deleted package version you want to restore, click **Restore**.
![Restore option next to a deleted package version](/assets/images/help/package-registry/restore-package-version.png)
5. To confirm, click **I understand the consequences, restore this version.**
![Confirm package version restoration](/assets/images/help/package-registry/confirm-package-version-restoration.png)

View File

@@ -14,3 +14,5 @@ versions:
{% link_in_list /about-github-packages %}
{% link_in_list /core-concepts-for-github-packages %}
{% link_in_list /publishing-a-package %}
{% link_in_list /deleting-and-restoring-a-package %}
{% link_in_list /deleting-a-package %}

View File

@@ -14,5 +14,4 @@ versions:
{% data reusables.package_registry.packages-ghes-release-stage %}
{% link_in_list /viewing-packages %}
{% link_in_list /installing-a-package %}
{% link_in_list /deleting-a-package %}
{% link_in_list /installing-a-package %}

View File

@@ -13,7 +13,7 @@ You only need an existing {% data variables.product.prodname_dotcom %} repositor
### Publishing your package
1. Create a new repository on {% data variables.product.prodname_dotcom %}, adding the `.gitignore` for Node. Create a private repository if youd like to delete this package later, public packages cannot be deleted. For more information, see "[Creating a new repository](/github/creating-cloning-and-archiving-repositories/creating-a-new-repository)."
1. Create a new repository on {% data variables.product.prodname_dotcom %}, adding the `.gitignore` for Node. {% if currentVersion ver_lt "enterprise-server@3.1" %} Create a private repository if youd like to delete this package later, public packages cannot be deleted.{% endif %} For more information, see "[Creating a new repository](/github/creating-cloning-and-archiving-repositories/creating-a-new-repository)."
2. Clone the repository to your local machine.
{% raw %}
```shell
@@ -36,7 +36,7 @@ You only need an existing {% data variables.product.prodname_dotcom %} repositor
...
test command: <em>exit 0</em>
...
$ npm install
$ git add index.js package.json package-lock.json
$ git commit -m "initialize npm package"
@@ -44,7 +44,7 @@ You only need an existing {% data variables.product.prodname_dotcom %} repositor
```
{% endraw %}
5. From your repository on {% data variables.product.prodname_dotcom %}, create a new file in the `.github/workflows` directory named `release-package.yml`. For more information, see "[Creating new files](/github/managing-files-in-a-repository/creating-new-files)."
6. Copy the following YAML content into the `release-package.yml` file.
6. Copy the following YAML content into the `release-package.yml` file.
{% raw %}
```yaml{:copy}
name: Node.js Package
@@ -96,7 +96,7 @@ Packages are published at the repository level. You can see all the packages in
### Installing a published package
Now that you've published the package, you'll want to use it as a dependency across your projects. For more information, see "[Configuring npm for use with {% data variables.product.prodname_registry %}](/packages/guides/configuring-npm-for-use-with-github-packages#installing-a-package)."
Now that you've published the package, you'll want to use it as a dependency across your projects. For more information, see "[Configuring npm for use with {% data variables.product.prodname_registry %}](/packages/guides/configuring-npm-for-use-with-github-packages#installing-a-package)."
### Next steps

View File

@@ -30,6 +30,7 @@ versions:
{% link_in_list /migrations %}
{% link_in_list /oauth-authorizations %}
{% link_in_list /orgs %}
{% link_in_list /packages %}
{% link_in_list /projects %}
{% link_in_list /pulls %}
{% link_in_list /rate-limit %}

View File

@@ -0,0 +1,28 @@
---
title: Packages
product: '{% data reusables.gated-features.packages %}'
versions:
free-pro-team: '*'
---
The {% data variables.product.prodname_registry %} API enables you to manage packages using the REST API. To learn more about restoring or deleting packages, see "[Restoring and deleting packages](/packages/learn-github-packages/deleting-and-restoring-a-package)."
To use this API, you must authenticate using a personal access token.
- To access package metadata, your token must include the `read:packages` scope.
- To delete packages and package versions, your token must include the `read:packages` and `delete:packages` scopes.
- To restore packages and package versions, your token must include the `read:packages` and `write:packages` scopes.
If your `package_type` is `npm`, `maven`, `rubygems`, or `nuget`, then your token must also include the `repo` scope since your package inherits permissions from a {% data variables.product.prodname_dotcom %} repository. For more information about scopes, see "[About scopes and permissions](/packages/learn-github-packages/about-github-packages#about-scopes-and-permissions-for-package-registries)" or "[Using the {% data variables.product.prodname_registry %} API with Docker](#using-the-github-packages-api-with-docker)."
If you want to use the {% data variables.product.prodname_registry %} API to access resources in an organization with SSO enabled, then you must enable SSO for your personal access token. For more information, see "[Authorizing a personal access token for use with SAML single sign-on](/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on)."
#### Using the {% data variables.product.prodname_registry %} API with Docker
If your package is a Docker image using the package namespace `docker.pkg.github.com/OWNER/REPOSITORY/IMAGE-NAME`, then your `package_type` is `docker` and your token must include the `repo` scope since your package inherits permissions from a {% data variables.product.prodname_dotcom %} repository.
If your package is a Docker image using the package namespace `ghcr.io/OWNER/IMAGE-NAME`, then your `package_type` is `container` and your token does not need the `repo` scope to access or manage this `package_type`. `container` packages offer granular permissions separate from a repository.
{% for operation in currentRestOperations %}
{% unless operation.subcategory %}{% include rest_operation %}{% endunless %}
{% endfor %}

View File

@@ -1,6 +1,3 @@
1. On {% data variables.product.prodname_dotcom %}, navigate to the main page of your organization.
2. Under your organization name, click **Packages**.
![Container access invite button](/assets/images/help/package-registry/org-tab-for-packages.png)
3. Search for and select your package.
4. In the top right of your container image's landing page, click **Package settings**.
![Package settings button](/assets/images/help/package-registry/packages-settings-from-package-landing-page.png)

View File

@@ -3,6 +3,3 @@
![Profile photo](/assets/images/help/profile/top_right_avatar.png)
3. On your profile page, in the top right, click **Packages**.
![Packages option on profile page](/assets/images/help/package-registry/packages-from-user-profile.png)
3. Search for and select your package.
4. In the top right of your container image's landing page, click **Package settings**.
![Package settings button](/assets/images/help/package-registry/packages-settings-from-package-landing-page.png)

View File

@@ -0,0 +1,3 @@
3. Search for and select your package.
4. In the top right of your package's landing page, click **Package settings**.
![Package settings button](/assets/images/help/package-registry/packages-settings-from-package-landing-page.png)

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff