v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2024-01-0382859610.0 MB
code-scanning

List instances of a code scanning alert

Lists all instances of the specified code scanning alert. You must use an access token with the security_events scope to use this endpoint with private repositories, the public_repo scope also grants permission to read security events on public repositories only.

get/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances

Path parameters

ownerstring required

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

repostring required

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

alert_numberinteger required

The security alert number.

The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the number field in the response from the GET /repos/{owner}/{repo}/code-scanning/alerts operation.

Query parameters

pageinteger

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

per_pageinteger

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

refstring

The Git reference, formatted as refs/pull/<number>/merge, refs/pull/<number>/head, refs/heads/<branch name> or simply <branch name>.

The Git reference for the results you want to list. The ref for a branch can be formatted either as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge.

Response

Response

refstring

The Git reference, formatted as refs/pull/<number>/merge, refs/pull/<number>/head, refs/heads/<branch name> or simply <branch name>.

analysis_keystring

Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.

environmentstring

Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed.

categorystring

Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.

state'open' | 'dismissed' | 'fixed'

State of a code scanning alert.

commit_shastring
html_urlstring
classificationsCodeScanningAlertClassification[]

Classifications that have been applied to the file that triggered the alert. For example identifying it as documentation, or a generated file.