setup
Creates, updates, deletes, gets or lists a setup resource.
Overview
| Name | setup |
| Type | Resource |
| Id | github.code_quality.setup |
Fields
The following fields are returned by SELECT queries:
- get_setup
Response
| Name | Datatype | Description |
|---|---|---|
ai_findings_option | string | The AI findings configuration for the repository. (disabled, on_push) |
languages | array | Languages to be analyzed. |
runner_label | string | Runner label to be used if the runner type is labeled. (example: code-scanning) |
runner_type | string | Runner type to be used. (standard, labeled) |
schedule | string | The frequency of the periodic analysis. (weekly) |
state | string | Code quality setup has been configured or not. (configured, not-configured) |
updated_at | string (date-time) | Timestamp of latest configuration update. (example: 2023-12-06T14:20:20.000Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_setup | select | owner, repo | 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. | |
update_setup | update | owner, repo, state, runner_type, runner_label, languages, ai_findings_option | 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. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
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. |
SELECT examples
- get_setup
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.
SELECT
ai_findings_option,
languages,
runner_label,
runner_type,
schedule,
state,
updated_at
FROM github.code_quality.setup
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;
UPDATE examples
- update_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.
UPDATE github.code_quality.setup
SET
state = '{{ state }}',
runner_type = '{{ runner_type }}',
runner_label = '{{ runner_label }}',
languages = '{{ languages }}',
ai_findings_option = '{{ ai_findings_option }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND state = '{{ state }}' --required
AND runner_type = '{{ runner_type }}' --required
AND runner_label = '{{ runner_label }}' --required
AND languages = '{{ languages }}' --required
AND ai_findings_option = '{{ ai_findings_option }}' --required;