Github API

Getting access, Developing, Testing

Back to Github

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 repos, the public_repo scope also grants permission to read security events on public repos only. GitHub Apps must have the security_events read permission to use this endpoint.

Input

type: object properties: parameters: type: object properties: owner: type: string description: The account owner of the repository. The name is not case sensitive. repo: type: string description: The name of the repository. The name is not case sensitive. alert_number: type: integer description: The security alert number. readOnly: true page: type: integer default: 1 description: Page number of the results to fetch. per_page: type: integer default: 30 description: The number of results per page (max 100). ref: type: string description: |- The full Git reference, formatted as `refs/heads/<branch name>`, `refs/pull/<number>/merge`, or `refs/pull/<number>/head`. required: - owner - repo - alert_number title: Parameters

Output

type: array items: type: object properties: ref: type: string description: |- The full Git reference, formatted as `refs/heads/<branch name>`, `refs/pull/<number>/merge`, or `refs/pull/<number>/head`. analysis_key: type: string description: >- Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. environment: type: string description: >- 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. category: type: string description: >- 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: type: string description: State of a code scanning alert. enum: - open - closed - dismissed - fixed commit_sha: type: string message: type: object properties: text: type: string location: type: object properties: path: type: string start_line: type: integer end_line: type: integer start_column: type: integer end_column: type: integer html_url: type: string classifications: type: array description: >- Classifications that have been applied to the file that triggered the alert. For example identifying it as documentation, or a generated file. items: type: string description: A classification of the file. For example to identify it as generated. nullable: true enum: - source - generated - test - library