Skip to content

Get a code scanning default setup configuration

GET
/repos/{owner}/{repo}/code-scanning/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.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

Response

Media type application/json

Configuration for code scanning default setup.

object
state

Code scanning default setup has been configured or not.

string
Allowed values: configured not-configured
languages

Languages to be analyzed.

Array<string>
Allowed values: actions c-cpp csharp go java-kotlin javascript-typescript javascript python ruby typescript swift
runner_type

Runner type to be used.

string
nullable
Allowed values: standard labeled
runner_label

Runner label to be used if the runner type is labeled.

string
nullable
query_suite

CodeQL query suite to be used.

string
Allowed values: default extended
threat_model

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.

string
Allowed values: remote remote_and_local
updated_at

Timestamp of latest configuration update.

string format: date-time
nullable
schedule

The frequency of the periodic analysis.

string
nullable
Allowed values: weekly
Examples
Example default
{
"state": "configured",
"languages": [
"ruby",
"python"
],
"query_suite": "default",
"threat_model": "remote",
"updated_at": "2023-01-19T11:21:34Z",
"schedule": "weekly"
}

Response if GitHub Advanced Security is not enabled for this repository

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Service unavailable

Media type application/json
object
code
string
message
string
documentation_url
string
Example generated
{
"code": "example",
"message": "example",
"documentation_url": "example"
}