Skip to content

feat: set endpoint methods on octokit.rest.*. octokit.* is still set, but no longer documented, and will be deprecated in future #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2021
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const MyOctokit = Octokit.plugin(restEndpointMethods);
const octokit = new MyOctokit({ auth: "secret123" });

// https://developer.github.com/v3/users/#get-the-authenticated-user
octokit.users.getAuthenticated();
octokit.rest.users.getAuthenticated();
```

There is one method for each REST API endpoint documented at [https://developer.github.com/v3](https://developer.github.com/v3). All endpoint methods are documented in the [docs/](docs/) folder, e.g. [docs/users/getAuthenticated.md](docs/users/getAuthenticated.md)
Expand All @@ -63,6 +63,8 @@ type UpdateLabelParameters = RestEndpointMethodTypes["issues"]["updateLabel"]["p
type UpdateLabelResponse = RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
```

In order to get types beyond parameters and responses, check out [`@octokit/openapi-types`](https://github.com/octokit/openapi-types.ts/#readme), which is a direct transpliation from GitHub's official OpenAPI specification.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/addSelectedRepoToOrgSecret.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Add selected repository to an organization secret
example: octokit.actions.addSelectedRepoToOrgSecret({ org, secret_name, repository_id })
example: octokit.rest.actions.addSelectedRepoToOrgSecret({ org, secret_name, repository_id })
route: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}
scope: actions
type: API method
Expand All @@ -11,7 +11,7 @@ type: API method
Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.

```js
octokit.actions.addSelectedRepoToOrgSecret({
octokit.rest.actions.addSelectedRepoToOrgSecret({
org,
secret_name,
repository_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/cancelWorkflowRun.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Cancel a workflow run
example: octokit.actions.cancelWorkflowRun({ owner, repo, run_id })
example: octokit.rest.actions.cancelWorkflowRun({ owner, repo, run_id })
route: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel
scope: actions
type: API method
Expand All @@ -11,7 +11,7 @@ type: API method
Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.

```js
octokit.actions.cancelWorkflowRun({
octokit.rest.actions.cancelWorkflowRun({
owner,
repo,
run_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createOrUpdateEnvironmentSecret.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create or update an environment secret
example: octokit.actions.createOrUpdateEnvironmentSecret({ repository_id, environment_name, secret_name })
example: octokit.rest.actions.createOrUpdateEnvironmentSecret({ repository_id, environment_name, secret_name })
route: PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}
scope: actions
type: API method
Expand Down Expand Up @@ -84,7 +84,7 @@ puts Base64.strict_encode64(encrypted_secret)
```

```js
octokit.actions.createOrUpdateEnvironmentSecret({
octokit.rest.actions.createOrUpdateEnvironmentSecret({
repository_id,
environment_name,
secret_name,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createOrUpdateOrgSecret.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create or update an organization secret
example: octokit.actions.createOrUpdateOrgSecret({ org, secret_name })
example: octokit.rest.actions.createOrUpdateOrgSecret({ org, secret_name })
route: PUT /orgs/{org}/actions/secrets/{secret_name}
scope: actions
type: API method
Expand Down Expand Up @@ -84,7 +84,7 @@ puts Base64.strict_encode64(encrypted_secret)
```

```js
octokit.actions.createOrUpdateOrgSecret({
octokit.rest.actions.createOrUpdateOrgSecret({
org,
secret_name,
});
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createOrUpdateRepoSecret.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create or update a repository secret
example: octokit.actions.createOrUpdateRepoSecret({ owner, repo, secret_name })
example: octokit.rest.actions.createOrUpdateRepoSecret({ owner, repo, secret_name })
route: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}
scope: actions
type: API method
Expand Down Expand Up @@ -84,7 +84,7 @@ puts Base64.strict_encode64(encrypted_secret)
```

```js
octokit.actions.createOrUpdateRepoSecret({
octokit.rest.actions.createOrUpdateRepoSecret({
owner,
repo,
secret_name,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createRegistrationTokenForOrg.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create a registration token for an organization
example: octokit.actions.createRegistrationTokenForOrg({ org })
example: octokit.rest.actions.createRegistrationTokenForOrg({ org })
route: POST /orgs/{org}/actions/runners/registration-token
scope: actions
type: API method
Expand All @@ -21,7 +21,7 @@ Configure your self-hosted runner, replacing `TOKEN` with the registration token
```

```js
octokit.actions.createRegistrationTokenForOrg({
octokit.rest.actions.createRegistrationTokenForOrg({
org,
});
```
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createRegistrationTokenForRepo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create a registration token for a repository
example: octokit.actions.createRegistrationTokenForRepo({ owner, repo })
example: octokit.rest.actions.createRegistrationTokenForRepo({ owner, repo })
route: POST /repos/{owner}/{repo}/actions/runners/registration-token
scope: actions
type: API method
Expand All @@ -20,7 +20,7 @@ Configure your self-hosted runner, replacing `TOKEN` with the registration token
```

```js
octokit.actions.createRegistrationTokenForRepo({
octokit.rest.actions.createRegistrationTokenForRepo({
owner,
repo,
});
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createRemoveTokenForOrg.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create a remove token for an organization
example: octokit.actions.createRemoveTokenForOrg({ org })
example: octokit.rest.actions.createRemoveTokenForOrg({ org })
route: POST /orgs/{org}/actions/runners/remove-token
scope: actions
type: API method
Expand All @@ -22,7 +22,7 @@ endpoint.
```

```js
octokit.actions.createRemoveTokenForOrg({
octokit.rest.actions.createRemoveTokenForOrg({
org,
});
```
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createRemoveTokenForRepo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create a remove token for a repository
example: octokit.actions.createRemoveTokenForRepo({ owner, repo })
example: octokit.rest.actions.createRemoveTokenForRepo({ owner, repo })
route: POST /repos/{owner}/{repo}/actions/runners/remove-token
scope: actions
type: API method
Expand All @@ -20,7 +20,7 @@ To remove your self-hosted runner from a repository, replace TOKEN with the remo
```

```js
octokit.actions.createRemoveTokenForRepo({
octokit.rest.actions.createRemoveTokenForRepo({
owner,
repo,
});
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/createWorkflowDispatch.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Create a workflow dispatch event
example: octokit.actions.createWorkflowDispatch({ owner, repo, workflow_id, ref })
example: octokit.rest.actions.createWorkflowDispatch({ owner, repo, workflow_id, ref })
route: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
scope: actions
type: API method
Expand All @@ -15,7 +15,7 @@ You must configure your GitHub Actions workflow to run when the [`workflow_dispa
You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)."

```js
octokit.actions.createWorkflowDispatch({
octokit.rest.actions.createWorkflowDispatch({
owner,
repo,
workflow_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteArtifact.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete an artifact
example: octokit.actions.deleteArtifact({ owner, repo, artifact_id })
example: octokit.rest.actions.deleteArtifact({ owner, repo, artifact_id })
route: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}
scope: actions
type: API method
Expand All @@ -11,7 +11,7 @@ type: API method
Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.

```js
octokit.actions.deleteArtifact({
octokit.rest.actions.deleteArtifact({
owner,
repo,
artifact_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteEnvironmentSecret.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete an environment secret
example: octokit.actions.deleteEnvironmentSecret({ repository_id, environment_name, secret_name })
example: octokit.rest.actions.deleteEnvironmentSecret({ repository_id, environment_name, secret_name })
route: DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}
scope: actions
type: API method
Expand All @@ -11,7 +11,7 @@ type: API method
Deletes a secret in an environment using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.

```js
octokit.actions.deleteEnvironmentSecret({
octokit.rest.actions.deleteEnvironmentSecret({
repository_id,
environment_name,
secret_name,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteOrgSecret.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete an organization secret
example: octokit.actions.deleteOrgSecret({ org, secret_name })
example: octokit.rest.actions.deleteOrgSecret({ org, secret_name })
route: DELETE /orgs/{org}/actions/secrets/{secret_name}
scope: actions
type: API method
Expand All @@ -11,7 +11,7 @@ type: API method
Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.

```js
octokit.actions.deleteOrgSecret({
octokit.rest.actions.deleteOrgSecret({
org,
secret_name,
});
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteRepoSecret.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete a repository secret
example: octokit.actions.deleteRepoSecret({ owner, repo, secret_name })
example: octokit.rest.actions.deleteRepoSecret({ owner, repo, secret_name })
route: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}
scope: actions
type: API method
Expand All @@ -11,7 +11,7 @@ type: API method
Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.

```js
octokit.actions.deleteRepoSecret({
octokit.rest.actions.deleteRepoSecret({
owner,
repo,
secret_name,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteSelfHostedRunnerFromOrg.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete a self-hosted runner from an organization
example: octokit.actions.deleteSelfHostedRunnerFromOrg({ org, runner_id })
example: octokit.rest.actions.deleteSelfHostedRunnerFromOrg({ org, runner_id })
route: DELETE /orgs/{org}/actions/runners/{runner_id}
scope: actions
type: API method
Expand All @@ -13,7 +13,7 @@ Forces the removal of a self-hosted runner from an organization. You can use thi
You must authenticate using an access token with the `admin:org` scope to use this endpoint.

```js
octokit.actions.deleteSelfHostedRunnerFromOrg({
octokit.rest.actions.deleteSelfHostedRunnerFromOrg({
org,
runner_id,
});
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteSelfHostedRunnerFromRepo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete a self-hosted runner from a repository
example: octokit.actions.deleteSelfHostedRunnerFromRepo({ owner, repo, runner_id })
example: octokit.rest.actions.deleteSelfHostedRunnerFromRepo({ owner, repo, runner_id })
route: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}
scope: actions
type: API method
Expand All @@ -14,7 +14,7 @@ You must authenticate using an access token with the `repo`
scope to use this endpoint.

```js
octokit.actions.deleteSelfHostedRunnerFromRepo({
octokit.rest.actions.deleteSelfHostedRunnerFromRepo({
owner,
repo,
runner_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteWorkflowRun.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete a workflow run
example: octokit.actions.deleteWorkflowRun({ owner, repo, run_id })
example: octokit.rest.actions.deleteWorkflowRun({ owner, repo, run_id })
route: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}
scope: actions
type: API method
Expand All @@ -13,7 +13,7 @@ private you must use an access token with the `repo` scope. GitHub Apps must hav
this endpoint.

```js
octokit.actions.deleteWorkflowRun({
octokit.rest.actions.deleteWorkflowRun({
owner,
repo,
run_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/deleteWorkflowRunLogs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Delete workflow run logs
example: octokit.actions.deleteWorkflowRunLogs({ owner, repo, run_id })
example: octokit.rest.actions.deleteWorkflowRunLogs({ owner, repo, run_id })
route: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs
scope: actions
type: API method
Expand All @@ -11,7 +11,7 @@ type: API method
Deletes all logs for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.

```js
octokit.actions.deleteWorkflowRunLogs({
octokit.rest.actions.deleteWorkflowRunLogs({
owner,
repo,
run_id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Disable a selected repository for GitHub Actions in an organization
example: octokit.actions.disableSelectedRepositoryGithubActionsOrganization({ org, repository_id })
example: octokit.rest.actions.disableSelectedRepositoryGithubActionsOrganization({ org, repository_id })
route: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}
scope: actions
type: API method
Expand All @@ -13,7 +13,7 @@ Removes a repository from the list of selected repositories that are enabled for
You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.

```js
octokit.actions.disableSelectedRepositoryGithubActionsOrganization({
octokit.rest.actions.disableSelectedRepositoryGithubActionsOrganization({
org,
repository_id,
});
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/disableWorkflow.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Disable a workflow
example: octokit.actions.disableWorkflow({ owner, repo, workflow_id })
example: octokit.rest.actions.disableWorkflow({ owner, repo, workflow_id })
route: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable
scope: actions
type: API method
Expand All @@ -13,7 +13,7 @@ Disables a workflow and sets the `state` of the workflow to `disabled_manually`.
You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.

```js
octokit.actions.disableWorkflow({
octokit.rest.actions.disableWorkflow({
owner,
repo,
workflow_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/downloadArtifact.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Download an artifact
example: octokit.actions.downloadArtifact({ owner, repo, artifact_id, archive_format })
example: octokit.rest.actions.downloadArtifact({ owner, repo, artifact_id, archive_format })
route: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
scope: actions
type: API method
Expand All @@ -14,7 +14,7 @@ the repository can use this endpoint. If the repository is private you must use
GitHub Apps must have the `actions:read` permission to use this endpoint.

```js
octokit.actions.downloadArtifact({
octokit.rest.actions.downloadArtifact({
owner,
repo,
artifact_id,
Expand Down
4 changes: 2 additions & 2 deletions docs/actions/downloadJobLogsForWorkflowRun.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Download job logs for a workflow run
example: octokit.actions.downloadJobLogsForWorkflowRun({ owner, repo, job_id })
example: octokit.rest.actions.downloadJobLogsForWorkflowRun({ owner, repo, job_id })
route: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
scope: actions
type: API method
Expand All @@ -14,7 +14,7 @@ use this endpoint. If the repository is private you must use an access token wit
have the `actions:read` permission to use this endpoint.

```js
octokit.actions.downloadJobLogsForWorkflowRun({
octokit.rest.actions.downloadJobLogsForWorkflowRun({
owner,
repo,
job_id,
Expand Down
Loading