Skip to main content
REST API はバージョン化されました。 詳細については、「API のバージョン管理について」を参照してください。

コード品質のための REST API エンドポイント

REST API を使用して、コード品質構成を管理します。

Get a code quality setup configuration

Gets a code quality setup configuration.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.

"Get a code quality setup configuration" のきめ細かいアクセス トークン

このエンドポイントは、次の粒度の細かいトークンの種類で動作します:

粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:

  • "Administration" repository permissions (write)

"Get a code quality setup configuration" のパラメーター

ヘッダー
名前, タイプ, 説明
accept string

Setting to application/vnd.github+json is recommended.

パスパラメーター
名前, タイプ, 説明
owner string 必須

The account owner of the repository. The name is not case sensitive.

repo string 必須

The name of the repository without the .git extension. The name is not case sensitive.

"Get a code quality setup configuration" の HTTP 応答状態コード

状態コード説明
200

OK

403

Response if the user is not authorized to access Code quality for this repository.

404

Resource not found

503

Service unavailable

"Get a code quality setup configuration" のコード サンプル

要求の例

get/repos/{owner}/{repo}/code-quality/setup
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/code-quality/setup

Response

Status: 200
{ "state": "configured", "languages": [ "javascript-typescript", "python" ], "runner_type": "standard", "runner_label": null, "updated_at": "2023-01-01T00:00:00Z", "schedule": "weekly" }

Update a code quality setup configuration

Updates a code quality setup configuration.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.

"Update a code quality setup configuration" のきめ細かいアクセス トークン

このエンドポイントは、次の粒度の細かいトークンの種類で動作します:

粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:

  • "Administration" repository permissions (write)

"Update a code quality setup configuration" のパラメーター

ヘッダー
名前, タイプ, 説明
accept string

Setting to application/vnd.github+json is recommended.

パスパラメーター
名前, タイプ, 説明
owner string 必須

The account owner of the repository. The name is not case sensitive.

repo string 必須

The name of the repository without the .git extension. The name is not case sensitive.

ボディパラメータ
名前, タイプ, 説明
state string

The desired state of code quality setup.

次のいずれかにできます: configured, not-configured

runner_type string

Runner type to be used.

次のいずれかにできます: standard, labeled

runner_label string or null

Runner label to be used if the runner type is labeled.

languages array of strings

Languages to be analyzed. Supported values are: csharp, go, java-kotlin, javascript-typescript, python, ruby

"Update a code quality setup configuration" の HTTP 応答状態コード

状態コード説明
200

OK

202

Accepted

403

Response if the repository is archived or if Code quality is not enabled for this repository

404

Resource not found

409

Response if there is already a code quality setup configuration update in progress

422

Response if the configuration change cannot be made

503

Service unavailable

"Update a code quality setup configuration" のコード サンプル

要求の例

patch/repos/{owner}/{repo}/code-quality/setup
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/code-quality/setup \ -d '{"state":"configured","languages":["javascript-typescript","python","ruby"]}'

Response

Status: 202
{ "run_id": 42, "run_url": "https://api.github.com/repos/octocat/hello-world/actions/runs/42" }