default_setup
Creates, updates, deletes, gets or lists a default_setup resource.
Overview
| Name | default_setup |
| Type | Resource |
| Id | github.code_scanning.default_setup |
Fields
The following fields are returned by SELECT queries:
- get_default_setup
Response
| Name | Datatype | Description |
|---|---|---|
languages | array | Languages to be analyzed. |
query_suite | string | CodeQL query suite to be used. (default, extended) |
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 scanning default setup has been configured or not. (configured, not-configured) |
threat_model | string | Threat 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_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_default_setup | select | owner, repo | 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. | |
update_default_setup | update | owner, repo | 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. |
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_default_setup
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
- update_default_setup
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;