provider code-scanning GET
/repos/{owner}/{repo}/code-scanning/codeql/databases/{language} @utdk/github
/repos/{owner}/{repo}/code-scanning/codeql/databases/{language} Get a CodeQL database for a repository
Gets a CodeQL database for a language in a repository.
By default this endpoint returns JSON metadata about the CodeQL database. To
download the CodeQL database binary content, set the `Accept` header of the request
to [`application/zip`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types), and make sure
your HTTP client is configured to follow redirects or use the `Location` header
to make a second request to get the redirect URL.
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.
- owner path required
- The account owner of the repository. The name is not case sensitive.
- string
- repo path required
- The name of the repository without the `.git` extension. The name is not case sensitive.
- string
- language path required
- The language of the CodeQL database.
- string
Try it
Authentication
Configure credentials for GitHub v3 REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import github from '@utdk/github';
await github.codeScanning.getCodeqlDatabase()