Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

코드 품질에 대한 REST API 엔드포인트

REST API를 사용하여 코드 품질 구성을 관리합니다.

List code quality findings for a repository

Lists code quality findings for a repository.

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.

"List code quality findings for a repository"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:

  • "Code quality" repository permissions (read)

"List code quality findings for a repository"에 대한 매개 변수

머리글
이름, 유형, 설명
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.

쿼리 매개 변수
이름, 유형, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

direction string

The direction to sort the results by.

기본값: desc

다음 중 하나일 수 있습니다.: asc, desc

before string

A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."

after string

A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."

state string

If specified, only code quality findings with this state will be returned.

다음 중 하나일 수 있습니다.: open, dismissed

"List code quality findings for a repository"에 대한 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

"List code quality findings for a repository"에 대한 코드 샘플

요청 예제

get/repos/{owner}/{repo}/code-quality/findings
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/findings

Response

Status: 200
[ { "number": 42, "state": "open", "url": "https://api.github.com/repos/octocat/hello-world/code-quality/findings/42", "rule": { "id": "java/useless-null-check", "title": "Useless null check", "description": "Checking whether an expression is null when that expression cannot possibly be null is useless.", "severity": "warning", "category": "maintainability" }, "location": { "path": "java/UselessNullCheck.java", "start_line": 9, "start_column": 4, "end_line": 9, "end_column": 18 }, "message": { "text": "This check is useless. o cannot be null at this check, since it is guarded by instanceof.", "markdown": "This check is useless. [o](java/UselessNullCheck.java#L9C4-L9C18) cannot be null at this check, since it is guarded by [...instanceof...](java/UselessNullCheck.java#L7C13-L7C25)." }, "created_at": "2026-01-23T12:34:56Z" } ]

Get a code quality finding

Gets a single code quality finding.

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 finding"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:

  • "Code quality" repository permissions (read)

"Get a code quality finding"에 대한 매개 변수

머리글
이름, 유형, 설명
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.

finding_number integer 필수

The number that identifies a finding.

"Get a code quality finding"에 대한 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 finding"에 대한 코드 샘플

요청 예제

get/repos/{owner}/{repo}/code-quality/findings/{finding_number}
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/findings/FINDING_NUMBER

Response

Status: 200
{ "number": 42, "state": "open", "url": "https://api.github.com/repos/octocat/hello-world/code-quality/findings/42", "rule": { "id": "java/useless-null-check", "title": "Useless null check", "description": "Checking whether an expression is null when that expression cannot possibly be null is useless.", "help": "# Useless null check\nSometimes you can guarantee that a particular variable will never be null. For example when that variable has just been assigned a newly created object or is the exception caught by a `catch` clause. A null check on such a variable is ...", "severity": "warning", "category": "maintainability" }, "location": { "path": "java/UselessNullCheck.java", "start_line": 9, "start_column": 4, "end_line": 9, "end_column": 18 }, "message": { "text": "This check is useless. o cannot be null at this check, since it is guarded by instanceof.", "markdown": "This check is useless. [o](java/UselessNullCheck.java#L9C4-L9C18) cannot be null at this check, since it is guarded by [...instanceof...](java/UselessNullCheck.java#L7C13-L7C25)." }, "created_at": "2026-01-23T12:34:56Z" }

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" }