v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
secret-scanning

List locations for a secret scanning alert

Lists all locations for a given secret scanning alert for an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

get/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations

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."

Response

Response

type'commit' | 'wiki_commit' | 'issue_title' | 'issue_body' | 'issue_comment' | 'discussion_title' | 'discussion_body' | 'discussion_comment' | 'pull_request_title' | 'pull_request_body' | 'pull_request_comment' | 'pull_request_review' | 'pull_request_review_comment'

The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found.

Example response

[
  {
    "type": "commit",
    "details": {
      "path": "/example/secrets.txt",
      "blob_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b",
      "commit_sha": "af5626b4a114abcb82d63db7c8082c3c4756e51b",
      "html_url": "https://github.com/octocat/Hello-World/blob/af5626b/example/secrets.txt#L1-L1"
    }
  }
]