Skip to content

Update a code quality setup configuration

PATCH
/repos/{owner}/{repo}/code-quality/setup

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.

API method documentation

owner
required
string

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

repo
required
string

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

Media type application/json
Any of:

Configuration for code quality setup.

object
state
required

The desired state of code quality setup.

string
Allowed values: configured not-configured
runner_type

Runner type to be used.

string
Allowed values: standard labeled
runner_label

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

string
nullable
languages

Languages to be analyzed.

Array<string>
Allowed values: csharp go java-kotlin javascript-typescript python ruby
Examples
Example default
{
"state": "configured",
"languages": [
"javascript-typescript",
"python",
"ruby"
]
}

Response

Media type application/json
Empty Object

An object without any properties.

object
Examples
Example default
null

Response

Media type application/json

You can use run_url to track the status of the run. This includes a property status and conclusion. You should not rely on this always being an actions workflow run object.

object
run_id

ID of the corresponding run.

integer
run_url

URL of the corresponding run.

string
Examples
Example default
{
"run_id": 42,
"run_url": "https://api.github.com/repos/octocat/hello-world/actions/runs/42"
}

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

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

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

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Response if the configuration change cannot be made

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Service unavailable

Media type application/json
object
code
string
message
string
documentation_url
string
Example generated
{
"code": "example",
"message": "example",
"documentation_url": "example"
}