POST
/repos/{owner}/{repo}/code-scanning/codeql/variant-analysesCreate a CodeQL variant analysis
Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories.
Get started by learning more about running CodeQL queries at scale with Multi-Repository Variant Analysis.
Use the owner and repo parameters in the URL to specify the controller repository that
will be used for running GitHub Actions workflows and storing the results of the CodeQL variant analysis.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
languagestringrequired
The language targeted by the CodeQL query
query_packstringrequired
A Base64-encoded tarball containing a CodeQL query and all its dependencies
repositoriesarray<string>optional
List of repository names (in the form `owner/repo-name`) to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required.
repository_listsarray<string>optional
List of repository lists to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required.
repository_ownersarray<string>optional
List of organization or user names whose repositories the query should be run against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required.
201Variant analysis submitted for processing
idintegerrequired
The ID of the variant analysis.
controller_repoobjectrequired
A GitHub repository.
actorobjectrequired
A GitHub user.
query_languagestringrequired
The language targeted by the CodeQL query
query_pack_urlstringrequired
The download url for the query pack.
created_atstringoptional
The date and time at which the variant analysis was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
updated_atstringoptional
The date and time at which the variant analysis was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
completed_atstringoptional
The date and time at which the variant analysis was completed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the variant analysis has not yet completed or this information is not available.
statusstringrequired
actions_workflow_run_idintegeroptional
The GitHub Actions workflow run used to execute this variant analysis. This is only available if the workflow run has started.
failure_reasonstringoptional
The reason for a failure of the variant analysis. This is only available if the variant analysis has failed.
scanned_repositoriesarray<object>optional
skipped_repositoriesobjectoptional
Information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis.
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Unable to process variant analysis submission
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
503Service unavailable
codestringoptional
messagestringoptional
documentation_urlstringoptional
Error handling
A 404 is returned: Resource not found. A 422 is returned: Unable to process variant analysis submission. A 503 is returned: Service unavailable.