---
title: "Update a code quality setup configuration"
method: PATCH
path: "/repos/{owner}/{repo}/code-quality/setup"
tags: ["code-quality"]
---

# 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.

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- union — Configuration for code quality setup.
  - object
    - `state` 'configured' | 'not-configured', required — The desired state of code quality setup.
    - `runner_type` 'standard' | 'labeled' — Runner type to be used.
    - `runner_label` string, nullable — Runner label to be used if the runner type is labeled.
    - `languages` string[] — Languages to be analyzed.
    - `ai_findings_option` 'disabled' | 'on_push' — Whether AI findings run for Code Quality on this repository.
  - object
    - `state` 'configured' | 'not-configured' — The desired state of code quality setup.
    - `runner_type` 'standard' | 'labeled', required — Runner type to be used.
    - `runner_label` string, nullable — Runner label to be used if the runner type is labeled.
    - `languages` string[] — Languages to be analyzed.
    - `ai_findings_option` 'disabled' | 'on_push' — Whether AI findings run for Code Quality on this repository.
  - object
    - `state` 'configured' | 'not-configured' — The desired state of code quality setup.
    - `runner_type` 'standard' | 'labeled' — Runner type to be used.
    - `runner_label` string, nullable, required — Runner label to be used if the runner type is labeled.
    - `languages` string[] — Languages to be analyzed.
    - `ai_findings_option` 'disabled' | 'on_push' — Whether AI findings run for Code Quality on this repository.
  - object
    - `state` 'configured' | 'not-configured' — The desired state of code quality setup.
    - `runner_type` 'standard' | 'labeled' — Runner type to be used.
    - `runner_label` string, nullable — Runner label to be used if the runner type is labeled.
    - `languages` string[], required — Languages to be analyzed.
    - `ai_findings_option` 'disabled' | 'on_push' — Whether AI findings run for Code Quality on this repository.
  - object
    - `state` 'configured' | 'not-configured' — The desired state of code quality setup.
    - `runner_type` 'standard' | 'labeled' — Runner type to be used.
    - `runner_label` string, nullable — Runner label to be used if the runner type is labeled.
    - `languages` string[] — Languages to be analyzed.
    - `ai_findings_option` 'disabled' | 'on_push', required — Whether AI findings run for Code Quality on this repository.

## Response `200`

Response

- EmptyObject — An object without any properties.

## Other responses

- `202` — Response
- `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

## Changes

> 62 revisions in range; 1 not diffed, 8 could not be searched.

- **2026-07-21** (2022-11-28) `5286c3553553` — 2 info
  - added the new optional request property `ai_findings_option`
  - added `subschema #5` to the request body `anyOf` list
- **2026-05-19** (2022-11-28) `7d8a6237c134` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/github/apis/rest/changes/repos/:owner/:repo/code-quality/setup/patch.md)

---

[API](https://skmtc.dev/github/apis/rest.md) · [All operations](https://skmtc.dev/github/apis/rest/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/github/rest/revisions/5bded2c77b93/schema)
