Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions docs/issues/setLabels.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Set labels for an issue
example: octokit.rest.issues.setLabels({ owner, repo, issue_number })
example: octokit.rest.issues.setLabels({ owner, repo, issue_number, labels[].name })
route: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels
scope: issues
type: API method
Expand All @@ -12,10 +12,11 @@ Removes any previous labels and sets the new labels for an issue.

```js
octokit.rest.issues.setLabels({
owner,
repo,
issue_number,
});
owner,
repo,
issue_number,
labels[].name
})
```

## Parameters
Expand All @@ -39,6 +40,12 @@ octokit.rest.issues.setLabels({

issue_number parameter

</td></tr>
<tr><td>labels</td><td>no</td><td>

</td></tr>
<tr><td>labels[].name</td><td>yes</td><td>

</td></tr>
</tbody>
</table>
Expand Down
53 changes: 53 additions & 0 deletions docs/packages/deletePackageForUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Delete a package for a user
example: octokit.rest.packages.deletePackageForUser({ package_type, package_name, username })
route: DELETE /users/{username}/packages/{package_type}/{package_name}
scope: packages
type: API method
---

# 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 `packages:read` and `packages:delete` scopes. In addition:

- If `package_type` is not `container`, your token must also include the `repo` scope.
- If `package_type` is `container`, you must also have admin permissions to the container you want to delete.

```js
octokit.rest.packages.deletePackageForUser({
package_type,
package_name,
username,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>package_type</td><td>yes</td><td>

The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` 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.

</td></tr>
<tr><td>package_name</td><td>yes</td><td>

The name of the package.

</td></tr>
<tr><td>username</td><td>yes</td><td>

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#delete-a-package-for-a-user).
59 changes: 59 additions & 0 deletions docs/packages/deletePackageVersionForUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: Delete package version for a user
example: octokit.rest.packages.deletePackageVersionForUser({ package_type, package_name, username, package_version_id })
route: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}
scope: packages
type: API method
---

# 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 `packages:read` and `packages:delete` scopes. In addition:

- If `package_type` is not `container`, your token must also include the `repo` scope.
- If `package_type` is `container`, you must also have admin permissions to the container you want to delete.

```js
octokit.rest.packages.deletePackageVersionForUser({
package_type,
package_name,
username,
package_version_id,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>package_type</td><td>yes</td><td>

The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` 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.

</td></tr>
<tr><td>package_name</td><td>yes</td><td>

The name of the package.

</td></tr>
<tr><td>username</td><td>yes</td><td>

</td></tr>
<tr><td>package_version_id</td><td>yes</td><td>

Unique identifier of the package version.

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#delete-a-package-version-for-a-user).
46 changes: 46 additions & 0 deletions docs/packages/listPackagesForAuthenticatedUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: List packages for the authenticated user's namespace
example: octokit.rest.packages.listPackagesForAuthenticatedUser({ package_type })
route: GET /user/packages
scope: packages
type: API method
---

# 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 `packages:read` scope.
If `package_type` is not `container`, your token must also include the `repo` scope.

```js
octokit.rest.packages.listPackagesForAuthenticatedUser({
package_type,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>package_type</td><td>yes</td><td>

The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` 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.

</td></tr>
<tr><td>visibility</td><td>no</td><td>

The selected visibility of the packages. Can be one of `public`, `private`, or `internal`. Only `container` package_types currently support `internal` visibility properly. For other ecosystems `internal` is synonymous with `private`. This parameter is optional and only filters an existing result set.

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#list-packages-for-the-authenticated-user).
50 changes: 50 additions & 0 deletions docs/packages/listPackagesForOrganization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: List packages for an organization
example: octokit.rest.packages.listPackagesForOrganization({ package_type, org })
route: GET /orgs/{org}/packages
scope: packages
type: API method
---

# List packages for an organization

Lists all packages in an organization readable by the user.

To use this endpoint, you must authenticate using an access token with the `packages:read` scope.
If `package_type` is not `container`, your token must also include the `repo` scope.

```js
octokit.rest.packages.listPackagesForOrganization({
package_type,
org,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>package_type</td><td>yes</td><td>

The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` 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.

</td></tr>
<tr><td>org</td><td>yes</td><td>

</td></tr>
<tr><td>visibility</td><td>no</td><td>

The selected visibility of the packages. Can be one of `public`, `private`, or `internal`. Only `container` package_types currently support `internal` visibility properly. For other ecosystems `internal` is synonymous with `private`. This parameter is optional and only filters an existing result set.

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#list-packages-for-an-organization).
50 changes: 50 additions & 0 deletions docs/packages/listPackagesForUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: List packages for a user
example: octokit.rest.packages.listPackagesForUser({ package_type, username })
route: GET /user/{username}/packages
scope: packages
type: API method
---

# 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 `packages:read` scope.
If `package_type` is not `container`, your token must also include the `repo` scope.

```js
octokit.rest.packages.listPackagesForUser({
package_type,
username,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>package_type</td><td>yes</td><td>

The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` 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.

</td></tr>
<tr><td>visibility</td><td>no</td><td>

The selected visibility of the packages. Can be one of `public`, `private`, or `internal`. Only `container` package_types currently support `internal` visibility properly. For other ecosystems `internal` is synonymous with `private`. This parameter is optional and only filters an existing result set.

</td></tr>
<tr><td>username</td><td>yes</td><td>

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#list-packages-for-user).
63 changes: 63 additions & 0 deletions docs/packages/restorePackageForUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Restore a package for a user
example: octokit.rest.packages.restorePackageForUser({ package_type, package_name, username })
route: POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}
scope: packages
type: API method
---

# 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 `packages:read` and `packages:write` scopes. In addition:

- If `package_type` is not `container`, your token must also include the `repo` scope.
- If `package_type` is `container`, you must also have admin permissions to the container that you want to restore.

```js
octokit.rest.packages.restorePackageForUser({
package_type,
package_name,
username,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>package_type</td><td>yes</td><td>

The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` 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.

</td></tr>
<tr><td>package_name</td><td>yes</td><td>

The name of the package.

</td></tr>
<tr><td>username</td><td>yes</td><td>

</td></tr>
<tr><td>token</td><td>no</td><td>

package token

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#restore-a-package-for-a-user).
Loading