Skip to main content

setup

Creates, updates, deletes, gets or lists a setup resource.

Overview

Namesetup
TypeResource
Idgithub.code_quality.setup

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
ai_findings_optionstringThe AI findings configuration for the repository. (disabled, on_push)
languagesarrayLanguages to be analyzed.
runner_labelstringRunner label to be used if the runner type is labeled. (example: code-scanning)
runner_typestringRunner type to be used. (standard, labeled)
schedulestringThe frequency of the periodic analysis. (weekly)
statestringCode quality setup has been configured or not. (configured, not-configured)
updated_atstring (date-time)Timestamp of latest configuration update. (example: 2023-12-06T14:20:20.000Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_setupselectowner, repoGets 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_setupupdateowner, repo, state, runner_type, runner_label, languages, ai_findings_optionUpdates 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.

NameDatatypeDescription
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.

SELECT examples

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

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;