Skip to main content

default_setup

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

Overview

Namedefault_setup
TypeResource
Idgithub.code_scanning.default_setup

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
languagesarrayLanguages to be analyzed.
query_suitestringCodeQL query suite to be used. (default, extended)
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 scanning default setup has been configured or not. (configured, not-configured)
threat_modelstringThreat model to be used for code scanning analysis. Use remote to analyze only network sources and remote_and_local to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. (remote, remote_and_local)
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_default_setupselectowner, repoGets a code scanning default 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_default_setupupdateowner, repoUpdates a code scanning default 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 scanning default 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
languages,
query_suite,
runner_label,
runner_type,
schedule,
state,
threat_model,
updated_at
FROM github.code_scanning.default_setup
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;

UPDATE examples

Updates a code scanning default 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_scanning.default_setup
SET
state = '{{ state }}',
runner_type = '{{ runner_type }}',
runner_label = '{{ runner_label }}',
query_suite = '{{ query_suite }}',
threat_model = '{{ threat_model }}',
languages = '{{ languages }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required;