From 78c4d13a8d9731eb9aceb2cf4857130014dcced4 Mon Sep 17 00:00:00 2001 From: Octokit Bot <33075676+octokitbot@users.noreply.github.com> Date: Tue, 5 Jan 2021 11:19:59 -0800 Subject: [PATCH] feat: `GET /enterprises/{enterprise}/audit-log`, `GET /orgs/{org}/audit-log`, `components/schemas/label` Interface (#19) --- cache/openapi-schema.json | 476 ++++++++++++++++++++++++++++++-------- generated/types.ts | 364 ++++++++++++++++------------- package.json | 2 +- 3 files changed, 583 insertions(+), 259 deletions(-) diff --git a/cache/openapi-schema.json b/cache/openapi-schema.json index 22ddf4abb..f9e7b5751 100644 --- a/cache/openapi-schema.json +++ b/cache/openapi-schema.json @@ -1,7 +1,7 @@ { "openapi": "3.0.3", "info": { - "version": "2.0.0", + "version": "2.1.0", "title": "GitHub's official OpenAPI spec + Octokit extension", "description": "OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs", "license": { "name": "MIT", "url": "https://spdx.org/licenses/MIT" }, @@ -599,7 +599,7 @@ "/app/installations/{installation_id}/suspended": { "put": { "summary": "Suspend an app installation", - "description": "**Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see \"[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/).\"\n\nSuspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.\n\nTo suspend a GitHub App, you must be an account owner or have admin permissions in the repository or organization where the app is installed.\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", + "description": "**Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see \"[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/).\"\n\nSuspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": ["apps"], "operationId": "apps/suspend-installation", "externalDocs": { @@ -622,7 +622,7 @@ }, "delete": { "summary": "Unsuspend an app installation", - "description": "**Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see \"[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/).\"\n\nRemoves a GitHub App installation suspension.\n\nTo unsuspend a GitHub App, you must be an account owner or have admin permissions in the repository or organization where the app is installed and suspended.\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", + "description": "**Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see \"[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/).\"\n\nRemoves a GitHub App installation suspension.\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": ["apps"], "operationId": "apps/unsuspend-installation", "externalDocs": { @@ -810,7 +810,7 @@ "/applications/{client_id}/grants/{access_token}": { "delete": { "summary": "Revoke a grant for an application", - "description": "**Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted.\n\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under \"Authorized OAuth Apps\" on GitHub](https://github.com/settings/applications#authorized).", + "description": "**Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted.\n\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under \"Authorized OAuth Apps\" on GitHub](https://github.com/settings/applications#authorized).", "tags": ["apps"], "operationId": "apps/revoke-grant-for-application", "externalDocs": { @@ -984,7 +984,7 @@ "/applications/{client_id}/tokens/{access_token}": { "get": { "summary": "Check an authorization", - "description": "**Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", + "description": "**Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", "tags": ["apps"], "operationId": "apps/check-authorization", "externalDocs": { @@ -1028,7 +1028,7 @@ }, "post": { "summary": "Reset an authorization", - "description": "**Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \"token\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", + "description": "**Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \"token\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", "tags": ["apps"], "operationId": "apps/reset-authorization", "externalDocs": { @@ -1068,7 +1068,7 @@ }, "delete": { "summary": "Revoke an authorization for an application", - "description": "**Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password.", + "description": "**Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password.", "tags": ["apps"], "operationId": "apps/revoke-authorization-for-application", "externalDocs": { @@ -2761,7 +2761,7 @@ "/enterprises/{enterprise}/actions/runners/registration-token": { "post": { "summary": "Create a registration token for an enterprise", - "description": "Returns a token that you can pass to the `config` script. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n\n#### Example using registration token\n\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n```\n./config.sh --url https://github.com/enterpises/octo-enterprise --token TOKEN\n```", + "description": "Returns a token that you can pass to the `config` script. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n\n#### Example using registration token\n\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n```\n./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN\n```", "operationId": "enterprise-admin/create-registration-token-for-enterprise", "tags": ["enterprise-admin"], "externalDocs": { @@ -2894,6 +2894,50 @@ "x-octokit": {} } }, + "/enterprises/{enterprise}/audit-log": { + "get": { + "summary": "Get the audit log for an enterprise", + "description": "**Note:** The audit log REST API is currently in beta and is subject to change. To join the beta, talk to your services or sales contact at GitHub.\n\nGets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the `admin:enterprise` scope.", + "operationId": "audit-log/get-audit-log", + "tags": ["audit-log"], + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/reference/enterprise-admin#get-the-audit-log-for-an-enterprise" + }, + "parameters": [ + { "$ref": "#/components/parameters/enterprise" }, + { "$ref": "#/components/parameters/audit-log-phrase" }, + { "$ref": "#/components/parameters/audit-log-include" }, + { "$ref": "#/components/parameters/audit-log-after" }, + { "$ref": "#/components/parameters/audit-log-before" }, + { "$ref": "#/components/parameters/per_page" } + ], + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { "$ref": "#/components/schemas/audit-log-event" } + }, + "examples": { + "default": { "$ref": "#/components/examples/audit-log" } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": false, + "previews": [], + "category": "enterprise-admin", + "subcategory": "audit-log" + }, + "x-octokit": {} + } + }, "/enterprises/{enterprise}/settings/billing/actions": { "get": { "summary": "Get GitHub Actions billing for an enterprise", @@ -6788,6 +6832,50 @@ "x-octokit": {} } }, + "/orgs/{org}/audit-log": { + "get": { + "summary": "Get the audit log for an organization", + "description": "**Note:** The audit log REST API is currently in beta and is subject to change. To join the beta, talk to your services or sales contact at GitHub.\n\nGets the audit log for an organization. For more information, see \"[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization).\"\n\nTo use this endpoint, you must be an organization owner, and you must use an access token with the `admin:org` scope. GitHub Apps must have the `organization_administration` read permission to use this endpoint.", + "operationId": "orgs/get-audit-log", + "tags": ["orgs"], + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/reference/orgs#get-the-audit-log-for-an-organization" + }, + "parameters": [ + { "$ref": "#/components/parameters/org" }, + { "$ref": "#/components/parameters/audit-log-phrase" }, + { "$ref": "#/components/parameters/audit-log-include" }, + { "$ref": "#/components/parameters/audit-log-after" }, + { "$ref": "#/components/parameters/audit-log-before" }, + { "$ref": "#/components/parameters/per_page" } + ], + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { "$ref": "#/components/schemas/audit-log-event" } + }, + "examples": { + "default": { "$ref": "#/components/examples/audit-log" } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": true, + "previews": [], + "category": "orgs", + "subcategory": null + }, + "x-octokit": {} + } + }, "/orgs/{org}/blocks": { "get": { "summary": "List users blocked by an organization", @@ -6821,7 +6909,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "orgs", "subcategory": "blocking" }, @@ -6856,7 +6950,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "orgs", "subcategory": "blocking" }, @@ -6882,7 +6982,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "orgs", "subcategory": "blocking" }, @@ -6905,7 +7011,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "orgs", "subcategory": "blocking" }, @@ -9126,7 +9238,7 @@ "/orgs/{org}/settings/billing/actions": { "get": { "summary": "Get GitHub Actions billing for an organization", - "description": "Gets the summary of the free and paid GitHub Actions minutes used.\n\nPaid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see \"[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)\".\n\nAccess tokens must have the `read:org` scope.", + "description": "Gets the summary of the free and paid GitHub Actions minutes used.\n\nPaid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see \"[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)\".\n\nAccess tokens must have the `repo` or `admin:org` scope.", "operationId": "billing/get-github-actions-billing-org", "tags": ["billing"], "externalDocs": { @@ -9164,7 +9276,7 @@ "/orgs/{org}/settings/billing/packages": { "get": { "summary": "Get GitHub Packages billing for an organization", - "description": "Gets the free and paid storage usued for GitHub Packages in gigabytes.\n\nPaid minutes only apply to packages stored for private repositories. For more information, see \"[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages).\"\n\nAccess tokens must have the `read:org` scope.", + "description": "Gets the free and paid storage usued for GitHub Packages in gigabytes.\n\nPaid minutes only apply to packages stored for private repositories. For more information, see \"[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages).\"\n\nAccess tokens must have the `repo` or `admin:org` scope.", "operationId": "billing/get-github-packages-billing-org", "tags": ["billing"], "externalDocs": { @@ -9202,7 +9314,7 @@ "/orgs/{org}/settings/billing/shared-storage": { "get": { "summary": "Get shared storage billing for an organization", - "description": "Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages.\n\nPaid minutes only apply to packages stored for private repositories. For more information, see \"[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages).\"\n\nAccess tokens must have the `read:org` scope.", + "description": "Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages.\n\nPaid minutes only apply to packages stored for private repositories. For more information, see \"[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages).\"\n\nAccess tokens must have the `repo` or `admin:org` scope.", "operationId": "billing/get-shared-storage-billing-org", "tags": ["billing"], "externalDocs": { @@ -17049,7 +17161,7 @@ "/repos/{owner}/{repo}/code-scanning/alerts": { "get": { "summary": "List code scanning alerts for a repository", - "description": "Lists all open code scanning alerts for the default branch (usually `main` or `master`). For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint.", + "description": "Lists all open code scanning alerts for the default branch (usually `main` or `master`). You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.", "tags": ["code-scanning"], "operationId": "code-scanning/list-alerts-for-repo", "externalDocs": { @@ -17095,6 +17207,9 @@ } } }, + "403": { + "description": "Response if GitHub Advanced Security is not enabled for this repository" + }, "404": { "description": "Response if the ref does not match an existing ref" }, @@ -17146,6 +17261,9 @@ } } }, + "403": { + "description": "Response if GitHub Advanced Security is not enabled for this repository" + }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, @@ -17169,7 +17287,7 @@ }, "patch": { "summary": "Update a code scanning alert", - "description": "Updates the status of a single code scanning alert. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes.\nGitHub Apps must have the `security_events` write permission to use this endpoint.", + "description": "Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.", "operationId": "code-scanning/update-alert", "tags": ["code-scanning"], "externalDocs": { @@ -17219,7 +17337,9 @@ } } }, - "403": { "description": "Response if the repository is archived" }, + "403": { + "description": "Response if the repository is archived, or if GitHub Advanced Security is not enabled for this repository" + }, "503": { "description": "Response when code scanning is not available and you should try again at a later time" } @@ -17236,7 +17356,7 @@ "/repos/{owner}/{repo}/code-scanning/analyses": { "get": { "summary": "List recent code scanning analyses for a repository", - "description": "List the details of recent code scanning analyses for a repository. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint.", + "description": "List the details of recent code scanning analyses for a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.", "operationId": "code-scanning/list-recent-analyses", "tags": ["code-scanning"], "externalDocs": { @@ -17283,6 +17403,9 @@ } } } + }, + "403": { + "description": "Response if GitHub Advanced Security is not enabled for this repository" } }, "x-github": { @@ -17297,7 +17420,7 @@ "/repos/{owner}/{repo}/code-scanning/sarifs": { "post": { "summary": "Upload a SARIF file", - "description": "Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository.\nFor private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` write permission to use this endpoint.", + "description": "Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.", "operationId": "code-scanning/upload-sarif", "tags": ["code-scanning"], "externalDocs": { @@ -17352,7 +17475,9 @@ "responses": { "202": { "description": "response" }, "400": { "description": "Response if the `sarif` field is invalid" }, - "403": { "description": "Response if the repository is archived" }, + "403": { + "description": "Response if the repository is archived, or if GitHub Advanced Security is not enabled for this repository" + }, "404": { "description": "Response if `commit_sha` or `ref` cannot be found" }, @@ -18686,7 +18811,7 @@ "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", - "description": "Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit\n`:path`, you will receive the contents of all files in the repository.\n\nFiles and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for\nretrieving the raw content or rendered HTML (when supported). All content types support [a custom media\ntype](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent\nobject format.\n\n**Note**:\n* To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees).\n* This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees\nAPI](https://docs.github.com/rest/reference/git#get-a-tree).\n* This API supports files up to 1 megabyte in size.\n\n#### If the content is a directory\nThe response will be an array of objects, one object for each item in the directory.\nWhen listing the contents of a directory, submodules have their \"type\" specified as \"file\". Logically, the value\n_should_ be \"submodule\". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW).\nIn the next major version of the API, the type will be returned as \"submodule\".\n\n#### If the content is a symlink \nIf the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the\nAPI responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object \ndescribing the symlink itself.\n\n#### If the content is a submodule\nThe `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific\ncommit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out\nthe submodule at that specific commit.\n\nIf the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\"git\"]`) and the\ngithub.com URLs (`html_url` and `_links[\"html\"]`) will have null values.", + "description": "Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit\n`:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. \n\nFiles and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for\nretrieving the raw content or rendered HTML (when supported). All content types support [a custom media\ntype](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent\nobject format.\n\n**Note**:\n* To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees).\n* This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees\nAPI](https://docs.github.com/rest/reference/git#get-a-tree).\n* This API supports files up to 1 megabyte in size.\n\n#### If the content is a directory\nThe response will be an array of objects, one object for each item in the directory.\nWhen listing the contents of a directory, submodules have their \"type\" specified as \"file\". Logically, the value\n_should_ be \"submodule\". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW).\nIn the next major version of the API, the type will be returned as \"submodule\".\n\n#### If the content is a symlink \nIf the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the\nAPI responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object \ndescribing the symlink itself.\n\n#### If the content is a submodule\nThe `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific\ncommit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out\nthe submodule at that specific commit.\n\nIf the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\"git\"]`) and the\ngithub.com URLs (`html_url` and `_links[\"html\"]`) will have null values.", "tags": ["repos"], "operationId": "repos/get-content", "externalDocs": { @@ -20588,7 +20713,7 @@ }, "base_tree": { "type": "string", - "description": "The SHA1 of the tree you want to update with new data. If you don't set this, the commit will be created on top of everything; however, it will only contain your change, the rest of your files will show up as deleted." + "description": "The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.\nIf not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit.\n" } }, "required": ["tree"] @@ -25306,7 +25431,7 @@ "/repos/{owner}/{repo}/pulls/comments": { "get": { "summary": "List review comments in a repository", - "description": "**Note:** Multi-line comments on pull requests are currently in public beta and subject to change.\n\nLists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.\n\n**Multi-line comment summary**\n\n**Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details.\n\nUse the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table.\n\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/rest/reference/reactions) reactions.", + "description": "Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.", "tags": ["pulls"], "operationId": "pulls/list-review-comments-for-repo", "externalDocs": { @@ -25356,7 +25481,7 @@ { "required": false, "name": "comfort-fade", - "note": "Multi-line comments in a pull request diff is currently available for developers to preview. To access the new response fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```" + "note": "Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```\n\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute." }, { "required": false, @@ -25373,7 +25498,7 @@ "/repos/{owner}/{repo}/pulls/comments/{comment_id}": { "get": { "summary": "Get a review comment for a pull request", - "description": "**Note:** Multi-line comments on pull requests are currently in public beta and subject to change.\n\nProvides details for a review comment.\n\n**Multi-line comment summary**\n\n**Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details.\n\nUse the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table.\n\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/rest/reference/reactions) reactions.", + "description": "Provides details for a review comment.", "tags": ["pulls"], "operationId": "pulls/get-review-comment", "externalDocs": { @@ -25410,7 +25535,7 @@ { "required": false, "name": "comfort-fade", - "note": "Multi-line comments in a pull request diff is currently available for developers to preview. To access the new response fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```" + "note": "Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```\n\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute." }, { "required": false, @@ -25425,7 +25550,7 @@ }, "patch": { "summary": "Update a review comment for a pull request", - "description": "**Note:** Multi-line comments on pull requests are currently in public beta and subject to change.\n\nEnables you to edit a review comment.\n\n**Multi-line comment summary**\n\n**Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details.\n\nUse the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table.", + "description": "Enables you to edit a review comment.", "tags": ["pulls"], "operationId": "pulls/update-review-comment", "externalDocs": { @@ -25478,7 +25603,7 @@ { "required": false, "name": "comfort-fade", - "note": "Multi-line comments in a pull request diff is currently available for developers to preview. To access the new response fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```" + "note": "Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```\n\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute." } ], "category": "pulls", @@ -25820,7 +25945,7 @@ "/repos/{owner}/{repo}/pulls/{pull_number}/comments": { "get": { "summary": "List review comments on a pull request", - "description": "**Note:** Multi-line comments on pull requests are currently in public beta and subject to change.\n\nLists all review comments for a pull request. By default, review comments are in ascending order by ID.\n\n**Multi-line comment summary**\n\n**Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details.\n\nUse the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table.\n\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/rest/reference/reactions) reactions.", + "description": "Lists all review comments for a pull request. By default, review comments are in ascending order by ID.", "tags": ["pulls"], "operationId": "pulls/list-review-comments", "externalDocs": { @@ -25871,7 +25996,7 @@ { "required": false, "name": "comfort-fade", - "note": "Multi-line comments in a pull request diff is currently available for developers to preview. To access the new response fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```" + "note": "Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```\n\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute." }, { "required": false, @@ -25886,7 +26011,7 @@ }, "post": { "summary": "Create a review comment for a pull request", - "description": "**Note:** Multi-line comments on pull requests are currently in public beta and subject to change.\n\nCreates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see \"[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment).\" We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff.\n\nYou can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see [Multi-line comment summary](https://docs.github.com/rest/reference/pulls#multi-line-comment-summary-3).\n\n**Note:** The position value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.\n\nThis endpoint triggers [notifications](https://help.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See \"[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)\" and \"[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)\" for details.\n\n**Multi-line comment summary**\n\n**Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details.\n\nUse the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table.", + "description": "\nCreates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see \"[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment).\" We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff.\n\nYou can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices).\n\n**Note:** The position value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.\n\nThis endpoint triggers [notifications](https://help.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See \"[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)\" and \"[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)\" for details.", "tags": ["pulls"], "operationId": "pulls/create-review-comment", "externalDocs": { @@ -26002,7 +26127,7 @@ { "required": false, "name": "comfort-fade", - "note": "Multi-line comments in a pull request diff is currently available for developers to preview. To access the new response fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```" + "note": "Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.comfort-fade-preview+json\n```\n\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\nIf you use the `comfort-fade` preview header, your response will show:\n\n* For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n* For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n* For multi-line comments, the last line of the comment range for the `position` attribute.\n* For single-line comments, the diff-positioned way of referencing comments for the `position` attribute." } ], "category": "pulls", @@ -32960,7 +33085,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "users", "subcategory": "blocking" }, @@ -32970,7 +33101,7 @@ "/user/blocks/{username}": { "get": { "summary": "Check if a user is blocked by the authenticated user", - "description": "If the user is blocked:\n\nIf the user is not blocked:", + "description": "", "tags": ["users"], "operationId": "users/check-blocked", "externalDocs": { @@ -32995,7 +33126,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "users", "subcategory": "blocking" }, @@ -33022,7 +33159,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "users", "subcategory": "blocking" }, @@ -33048,7 +33191,13 @@ "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, - "previews": [], + "previews": [ + { + "required": true, + "name": "giant-sentry-fist", + "note": "The API to block users is currently available for developers to preview. See the [preview notice](https://docs.github.com/rest/overview/api-previews#user-blocking) for more information.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.giant-sentry-fist-preview+json\n```" + } + ], "category": "users", "subcategory": "blocking" }, @@ -34998,7 +35147,6 @@ "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, - "418": { "description": "Response definition missing" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { @@ -38087,6 +38235,79 @@ }, "required": ["token", "expires_at"] }, + "audit-log-event": { + "type": "object", + "properties": { + "@timestamp": { + "type": "integer", + "description": "The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time)." + }, + "action": { + "type": "string", + "description": "The name of the action that was performed, for example `user.login` or `repo.create`." + }, + "active": { "type": "boolean" }, + "active_was": { "type": "boolean" }, + "actor": { + "type": "string", + "description": "The actor who performed the action." + }, + "blocked_user": { + "type": "string", + "description": "The username of the account being blocked." + }, + "business": { "type": "string" }, + "config": { "type": "array" }, + "config_was": { "type": "array" }, + "content_type": { "type": "string" }, + "created_at": { + "type": "integer", + "description": "The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time)." + }, + "deploy_key_fingerprint": { "type": "string" }, + "emoji": { "type": "string" }, + "events": { "type": "array" }, + "events_were": { "type": "array" }, + "explanation": { "type": "string" }, + "fingerprint": { "type": "string" }, + "hook_id": { "type": "integer" }, + "limited_availability": { "type": "boolean" }, + "message": { "type": "string" }, + "name": { "type": "string" }, + "old_user": { "type": "string" }, + "openssh_public_key": { "type": "string" }, + "org": { "type": "string" }, + "previous_visibility": { "type": "string" }, + "read_only": { "type": "boolean" }, + "repo": { + "type": "string", + "description": "The name of the repository." + }, + "repository": { + "type": "string", + "description": "The name of the repository." + }, + "repository_public": { "type": "boolean" }, + "target_login": { "type": "string" }, + "team": { "type": "string" }, + "transport_protocol": { + "type": "integer", + "description": "The type of protocol (for example, HTTP or SSH) used to transfer Git data." + }, + "transport_protocol_name": { + "type": "string", + "description": "A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data." + }, + "user": { + "type": "string", + "description": "The user that was affected by the action performed (if available)." + }, + "visibility": { + "type": "string", + "description": "The repository visibility, for example `public` or `private`." + } + } + }, "actions-billing-usage": { "type": "object", "properties": { @@ -38169,6 +38390,49 @@ }, "required": ["id", "login", "gravatar_id", "url", "avatar_url"] }, + "label": { + "title": "Label", + "description": "Color-coded labels help you categorize and filter your issues (just like labels in Gmail).", + "type": "object", + "properties": { + "id": { "type": "integer", "example": 208045946 }, + "node_id": { + "type": "string", + "example": "MDU6TGFiZWwyMDgwNDU5NDY=" + }, + "url": { + "description": "URL for the label", + "example": "https://api.github.com/repositories/42/labels/bug", + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the label.", + "example": "bug", + "type": "string" + }, + "description": { + "type": "string", + "example": "Something isn't working", + "nullable": true + }, + "color": { + "description": "6-character hex code, without the leading #, identifying the color", + "example": "FFFFFF", + "type": "string" + }, + "default": { "type": "boolean", "example": true } + }, + "required": [ + "id", + "node_id", + "url", + "name", + "description", + "color", + "default" + ] + }, "milestone": { "title": "Milestone", "description": "A collection of related issues and pull requests.", @@ -38313,18 +38577,7 @@ }, "labels": { "type": "array", - "items": { - "type": "object", - "properties": { - "id": { "type": "integer" }, - "node_id": { "type": "string" }, - "url": { "type": "string" }, - "name": { "type": "string" }, - "description": { "type": "string", "nullable": true }, - "color": { "type": "string" }, - "default": { "type": "boolean" } - } - } + "items": { "$ref": "#/components/schemas/label" } }, "assignee": { "nullable": true, @@ -45605,41 +45858,6 @@ } } }, - "label": { - "title": "Label", - "description": "Color-coded labels help you categorize and filter your issues (just like labels in Gmail).", - "type": "object", - "properties": { - "id": { "type": "integer", "example": 208045946 }, - "node_id": { - "type": "string", - "example": "MDU6TGFiZWwyMDgwNDU5NDY=" - }, - "url": { - "description": "URL for the label", - "example": "https://api.github.com/repositories/42/labels/bug", - "type": "string", - "format": "uri" - }, - "name": { - "description": "The name of the label.", - "example": "bug", - "type": "string" - }, - "description": { - "type": "string", - "example": "Something isn't working", - "nullable": true - }, - "color": { - "description": "6-character hex code, without the leading #, identifying the color", - "example": "FFFFFF", - "type": "string" - }, - "default": { "type": "boolean", "example": true } - }, - "required": ["color", "name", "id", "node_id", "default", "url"] - }, "deploy-key": { "title": "Deploy Key", "description": "An SSH key granting access to a single repository.", @@ -49649,6 +49867,35 @@ ] } }, + "audit-log": { + "value": [ + { + "@timestamp": 1606929874512, + "action": "team.add_member", + "actor": "octocat", + "created_at": 1606929874512, + "org": "octo-corp", + "team": "octo-corp/example-team", + "user": "monalisa" + }, + { + "@timestamp": 1606507117008, + "action": "org.create", + "actor": "octocat", + "created_at": 1606507117008, + "org": "octocat-test-org" + }, + { + "@timestamp": 1605719148837, + "action": "repo.destroy", + "actor": "monalisa", + "created_at": 1605719148837, + "org": "mona-org", + "repo": "mona-org/mona-test-repo", + "visibility": "private" + } + ] + }, "actions-billing-usage": { "value": { "total_minutes_used": 305, @@ -51479,7 +51726,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -52472,7 +52719,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -53144,7 +53391,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -53781,7 +54028,7 @@ "created_at": "2011-01-26T19:01:12Z", "updated_at": "2011-01-26T19:14:43Z", "git_url": "git://github.com/LindseyB/cosee.git", - "ssh_url": "git@github.com=>LindseyB/cosee.git", + "ssh_url": "git@github.com:LindseyB/cosee.git", "clone_url": "https://github.com/LindseyB/cosee.git", "svn_url": "https://github.com/LindseyB/cosee", "homepage": null, @@ -55033,7 +55280,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -55081,7 +55328,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -55172,7 +55419,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -55236,7 +55483,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -56720,7 +56967,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -57448,7 +57695,7 @@ "key": "contributor_covenant", "name": "Contributor Covenant", "url": "https://github.com/LindseyB/cosee/blob/master/CODE_OF_CONDUCT.md", - "body": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include=>\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include=>\n\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\nto any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\nposting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lindseyb@github.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n", + "body": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\nto any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\nposting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lindseyb@github.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n", "html_url": "https://github.com/LindseyB/cosee/blob/master/CODE_OF_CONDUCT.md" } }, @@ -60439,7 +60686,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -61058,7 +61305,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -61293,7 +61540,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -64285,6 +64532,7 @@ "account": { "login": "github", "id": 4, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "email": null, "organization_billing_email": "billing@github.com", @@ -65206,7 +65454,7 @@ "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://api.github.com/teams/1", - "html_url": "https://api.github.com/teams/justice-league", + "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", @@ -65651,6 +65899,34 @@ "required": true, "schema": { "type": "integer" } }, + "audit-log-phrase": { + "name": "phrase", + "description": "A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log).", + "in": "query", + "required": false, + "schema": { "type": "string" } + }, + "audit-log-include": { + "name": "include", + "description": "The event types to include:\n\n- `web` - returns web (non-Git) events\n- `git` - returns Git events\n- `all` - returns both web and Git events\n\nThe default is `web`.", + "in": "query", + "required": false, + "schema": { "type": "string", "enum": ["web", "git", "all"] } + }, + "audit-log-after": { + "name": "after", + "description": "A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor.", + "in": "query", + "required": false, + "schema": { "type": "string" } + }, + "audit-log-before": { + "name": "before", + "description": "A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor.", + "in": "query", + "required": false, + "schema": { "type": "string" } + }, "gist_id": { "name": "gist_id", "description": "gist_id parameter", diff --git a/generated/types.ts b/generated/types.ts index b96985193..e5bca3ea1 100644 --- a/generated/types.ts +++ b/generated/types.ts @@ -141,6 +141,9 @@ export interface paths { get: operations["enterprise-admin/get-self-hosted-runner-for-enterprise"]; delete: operations["enterprise-admin/delete-self-hosted-runner-from-enterprise"]; }; + "/enterprises/{enterprise}/audit-log": { + get: operations["audit-log/get-audit-log"]; + }; "/enterprises/{enterprise}/settings/billing/actions": { get: operations["billing/get-github-actions-billing-ghe"]; }; @@ -345,6 +348,9 @@ export interface paths { put: operations["actions/add-selected-repo-to-org-secret"]; delete: operations["actions/remove-selected-repo-from-org-secret"]; }; + "/orgs/{org}/audit-log": { + get: operations["orgs/get-audit-log"]; + }; "/orgs/{org}/blocks": { get: operations["orgs/list-blocked-users"]; }; @@ -1839,8 +1845,6 @@ export interface operations { * * Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. * - * To suspend a GitHub App, you must be an account owner or have admin permissions in the repository or organization where the app is installed. - * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ "apps/suspend-installation": { @@ -1862,8 +1866,6 @@ export interface operations { * * Removes a GitHub App installation suspension. * - * To unsuspend a GitHub App, you must be an account owner or have admin permissions in the repository or organization where the app is installed and suspended. - * * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ "apps/unsuspend-installation": { @@ -1974,7 +1976,7 @@ export interface operations { }; }; /** - * **Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted. * @@ -2075,7 +2077,7 @@ export interface operations { }; }; /** - * **Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ @@ -2097,7 +2099,7 @@ export interface operations { }; }; /** - * **Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ @@ -2118,7 +2120,7 @@ export interface operations { }; }; /** - * **Deprecation Notice:** GitHub will replace and discontinue OAuth endpoints containing `access_token` in the path parameter. We are introducing new endpoints that allow you to securely manage tokens for OAuth Apps by using `access_token` as an input parameter. The OAuth Application API will be removed on May 5, 2021. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). * * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ @@ -3092,7 +3094,7 @@ export interface operations { * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. * * ``` - * ./config.sh --url https://github.com/enterpises/octo-enterprise --token TOKEN + * ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN * ``` */ "enterprise-admin/create-registration-token-for-enterprise": { @@ -3179,6 +3181,33 @@ export interface operations { "204": never; }; }; + /** + * **Note:** The audit log REST API is currently in beta and is subject to change. To join the beta, talk to your services or sales contact at GitHub. + * + * Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the `admin:enterprise` scope. + */ + "audit-log/get-audit-log": { + parameters: { + path: { + enterprise: components["parameters"]["enterprise"]; + }; + query: { + phrase?: components["parameters"]["audit-log-phrase"]; + include?: components["parameters"]["audit-log-include"]; + after?: components["parameters"]["audit-log-after"]; + before?: components["parameters"]["audit-log-before"]; + per_page?: components["parameters"]["per_page"]; + }; + }; + responses: { + /** + * Response + */ + "200": { + "application/json": components["schemas"]["audit-log-event"][]; + }; + }; + }; /** * Gets the summary of the free and paid GitHub Actions minutes used. * @@ -5447,6 +5476,35 @@ export interface operations { "409": unknown; }; }; + /** + * **Note:** The audit log REST API is currently in beta and is subject to change. To join the beta, talk to your services or sales contact at GitHub. + * + * Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." + * + * To use this endpoint, you must be an organization owner, and you must use an access token with the `admin:org` scope. GitHub Apps must have the `organization_administration` read permission to use this endpoint. + */ + "orgs/get-audit-log": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + phrase?: components["parameters"]["audit-log-phrase"]; + include?: components["parameters"]["audit-log-include"]; + after?: components["parameters"]["audit-log-after"]; + before?: components["parameters"]["audit-log-before"]; + per_page?: components["parameters"]["per_page"]; + }; + }; + responses: { + /** + * Response + */ + "200": { + "application/json": components["schemas"]["audit-log-event"][]; + }; + }; + }; /** * List the users blocked by an organization. */ @@ -6721,7 +6779,7 @@ export interface operations { * * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * - * Access tokens must have the `read:org` scope. + * Access tokens must have the `repo` or `admin:org` scope. */ "billing/get-github-actions-billing-org": { parameters: { @@ -6743,7 +6801,7 @@ export interface operations { * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * - * Access tokens must have the `read:org` scope. + * Access tokens must have the `repo` or `admin:org` scope. */ "billing/get-github-packages-billing-org": { parameters: { @@ -6765,7 +6823,7 @@ export interface operations { * * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * - * Access tokens must have the `read:org` scope. + * Access tokens must have the `repo` or `admin:org` scope. */ "billing/get-shared-storage-billing-org": { parameters: { @@ -11300,7 +11358,7 @@ export interface operations { }; }; /** - * Lists all open code scanning alerts for the default branch (usually `main` or `master`). For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint. + * Lists all open code scanning alerts for the default branch (usually `main` or `master`). You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ "code-scanning/list-alerts-for-repo": { parameters: { @@ -11326,6 +11384,10 @@ export interface operations { "200": { "application/json": components["schemas"]["code-scanning-alert-code-scanning-alert-items"][]; }; + /** + * Response if GitHub Advanced Security is not enabled for this repository + */ + "403": unknown; /** * Response if the ref does not match an existing ref */ @@ -11353,13 +11415,16 @@ export interface operations { "200": { "application/json": components["schemas"]["code-scanning-alert-code-scanning-alert"]; }; + /** + * Response if GitHub Advanced Security is not enabled for this repository + */ + "403": unknown; "404": unknown; "503": unknown; }; }; /** - * Updates the status of a single code scanning alert. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. - * GitHub Apps must have the `security_events` write permission to use this endpoint. + * Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. */ "code-scanning/update-alert": { parameters: { @@ -11383,7 +11448,7 @@ export interface operations { "application/json": components["schemas"]["code-scanning-alert-code-scanning-alert"]; }; /** - * Response if the repository is archived + * Response if the repository is archived, or if GitHub Advanced Security is not enabled for this repository */ "403": unknown; /** @@ -11393,7 +11458,7 @@ export interface operations { }; }; /** - * List the details of recent code scanning analyses for a repository. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint. + * List the details of recent code scanning analyses for a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ "code-scanning/list-recent-analyses": { parameters: { @@ -11419,11 +11484,14 @@ export interface operations { "200": { "application/json": components["schemas"]["code-scanning-analysis-code-scanning-analysis"][]; }; + /** + * Response if GitHub Advanced Security is not enabled for this repository + */ + "403": unknown; }; }; /** - * Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. - * For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` write permission to use this endpoint. + * Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. */ "code-scanning/upload-sarif": { parameters: { @@ -11459,7 +11527,7 @@ export interface operations { */ "400": unknown; /** - * Response if the repository is archived + * Response if the repository is archived, or if GitHub Advanced Security is not enabled for this repository */ "403": unknown; /** @@ -12297,7 +12365,7 @@ export interface operations { }; /** * Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit - * `:path`, you will receive the contents of all files in the repository. + * `:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. * * Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for * retrieving the raw content or rendered HTML (when supported). All content types support [a custom media @@ -13517,7 +13585,8 @@ export interface operations { content?: string; }[]; /** - * The SHA1 of the tree you want to update with new data. If you don't set this, the commit will be created on top of everything; however, it will only contain your change, the rest of your files will show up as deleted. + * The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on. + * If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. */ base_tree?: string; }; @@ -15973,27 +16042,7 @@ export interface operations { }; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table. - * - * The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/rest/reference/reactions) reactions. */ "pulls/list-review-comments-for-repo": { parameters: { @@ -16022,27 +16071,7 @@ export interface operations { }; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Provides details for a review comment. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table. - * - * The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/rest/reference/reactions) reactions. */ "pulls/get-review-comment": { parameters: { @@ -16063,25 +16092,7 @@ export interface operations { }; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Enables you to edit a review comment. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table. */ "pulls/update-review-comment": { parameters: { @@ -16316,27 +16327,7 @@ export interface operations { }; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Lists all review comments for a pull request. By default, review comments are in ascending order by ID. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table. - * - * The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/rest/reference/reactions) reactions. */ "pulls/list-review-comments": { parameters: { @@ -16366,31 +16357,13 @@ export interface operations { }; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff. * - * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see [Multi-line comment summary](https://docs.github.com/rest/reference/pulls#multi-line-comment-summary-3). + * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). * * **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. * * This endpoint triggers [notifications](https://help.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://docs.github.com/rest/reference/pulls#parameters-2) table. */ "pulls/create-review-comment": { parameters: { @@ -20276,11 +20249,6 @@ export interface operations { "415": unknown; }; }; - /** - * If the user is blocked: - * - * If the user is not blocked: - */ "users/check-blocked": { parameters: { path: { @@ -21373,10 +21341,6 @@ export interface operations { "304": never; "401": unknown; "403": unknown; - /** - * Response definition missing - */ - "418": unknown; "422": unknown; }; }; @@ -22268,6 +22232,28 @@ export interface components { * Unique identifier of the self-hosted runner. */ runner_id: number; + /** + * A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). + */ + "audit-log-phrase": string; + /** + * The event types to include: + * + * - `web` - returns web (non-Git) events + * - `git` - returns Git events + * - `all` - returns both web and Git events + * + * The default is `web`. + */ + "audit-log-include": "web" | "git" | "all"; + /** + * A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. + */ + "audit-log-after": string; + /** + * A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. + */ + "audit-log-before": string; /** * gist_id parameter */ @@ -23158,6 +23144,76 @@ export interface components { */ repository_selection?: "all" | "selected"; }; + "audit-log-event": { + /** + * The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + */ + "@timestamp"?: number; + /** + * The name of the action that was performed, for example `user.login` or `repo.create`. + */ + action?: string; + active?: boolean; + active_was?: boolean; + /** + * The actor who performed the action. + */ + actor?: string; + /** + * The username of the account being blocked. + */ + blocked_user?: string; + business?: string; + config?: any[]; + config_was?: any[]; + content_type?: string; + /** + * The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + */ + created_at?: number; + deploy_key_fingerprint?: string; + emoji?: string; + events?: any[]; + events_were?: any[]; + explanation?: string; + fingerprint?: string; + hook_id?: number; + limited_availability?: boolean; + message?: string; + name?: string; + old_user?: string; + openssh_public_key?: string; + org?: string; + previous_visibility?: string; + read_only?: boolean; + /** + * The name of the repository. + */ + repo?: string; + /** + * The name of the repository. + */ + repository?: string; + repository_public?: boolean; + target_login?: string; + team?: string; + /** + * The type of protocol (for example, HTTP or SSH) used to transfer Git data. + */ + transport_protocol?: number; + /** + * A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. + */ + transport_protocol_name?: string; + /** + * The user that was affected by the action performed (if available). + */ + user?: string; + /** + * The repository visibility, for example `public` or `private`. + */ + visibility?: string; + }; "actions-billing-usage": { /** * The sum of the free and paid GitHub Actions minutes used. @@ -23225,6 +23281,27 @@ export interface components { url: string; avatar_url: string; }; + /** + * Color-coded labels help you categorize and filter your issues (just like labels in Gmail). + */ + label: { + id: number; + node_id: string; + /** + * URL for the label + */ + url: string; + /** + * The name of the label. + */ + name: string; + description: string | null; + /** + * 6-character hex code, without the leading #, identifying the color + */ + color: string; + default: boolean; + }; /** * A collection of related issues and pull requests. */ @@ -23272,15 +23349,7 @@ export interface components { title: string; body?: string; user: components["schemas"]["simple-user"] | null; - labels: { - id?: number; - node_id?: string; - url?: string; - name?: string; - description?: string | null; - color?: string; - default?: boolean; - }[]; + labels: components["schemas"]["label"][]; assignee: components["schemas"]["simple-user"] | null; assignees?: components["schemas"]["simple-user"][] | null; milestone: components["schemas"]["milestone"] | null; @@ -26351,27 +26420,6 @@ export interface components { body_html?: string; body_text?: string; }; - /** - * Color-coded labels help you categorize and filter your issues (just like labels in Gmail). - */ - label: { - id: number; - node_id: string; - /** - * URL for the label - */ - url: string; - /** - * The name of the label. - */ - name: string; - description?: string | null; - /** - * 6-character hex code, without the leading #, identifying the color - */ - color: string; - default: boolean; - }; /** * An SSH key granting access to a single repository. */ diff --git a/package.json b/package.json index 5efe9ee1b..6825e2d7d 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,6 @@ "branches": "main" }, "octokit": { - "openapi-version": "2.0.0" + "openapi-version": "2.1.0" } }