REST-API-Endpunkte für die Codequalität
Verwenden Sie die REST-API, um eine Codequalitätskonfiguration zu verwalten.
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.
Feinkörnige Zugriffstoken für "Get a code quality setup configuration"
Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:
- GitHub App-Benutzerzugriffstoken
- GitHub-App-Installations-Zugriffstoken
- Feingranulare persönliche Zugriffstoken
Das differenzierte Token muss über den folgenden Berechtigungssatz verfügen.:
- "Administration" repository permissions (write)
Parameter für "Get a code quality setup configuration"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive. |
repo string ErforderlichThe name of the repository without the |
HTTP-Antwortstatuscodes für "Get a code quality setup configuration"
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
403 | Response if the user is not authorized to access Code quality for this repository. |
404 | Resource not found |
503 | Service unavailable |
Codebeispiele für "Get a code quality setup configuration"
Anforderungsbeispiel
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/setupResponse
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.
Feinkörnige Zugriffstoken für "Update a code quality setup configuration"
Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:
- GitHub App-Benutzerzugriffstoken
- GitHub-App-Installations-Zugriffstoken
- Feingranulare persönliche Zugriffstoken
Das differenzierte Token muss über den folgenden Berechtigungssatz verfügen.:
- "Administration" repository permissions (write)
Parameter für "Update a code quality setup configuration"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive. |
repo string ErforderlichThe name of the repository without the |
| Name, Typ, BESCHREIBUNG |
|---|
state string The desired state of code quality setup. Kann eine der folgenden sein: |
runner_type string Runner type to be used. Kann eine der folgenden sein: |
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: |
HTTP-Antwortstatuscodes für "Update a code quality setup configuration"
| Statuscode | BESCHREIBUNG |
|---|---|
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 |
Codebeispiele für "Update a code quality setup configuration"
Anforderungsbeispiel
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"
}