Skip to content

GitHub: Get the analysis status of a repository in a Code QL variant analysis

GitHub codeScanning.codeScanningGetVariantAnalysisRepoTask: arguments, response, policy and SDK examples.

← Code scanning operations · Get started

Operation github.code_scanning_get_variant_analysis_repo_task

Provider route: GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["codeScanning"]["codeScanningGetVariantAnalysisRepoTask"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.codeScanning.codeScanningGetVariantAnalysisRepoTask(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_github import GitHubIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.code_scanning.code_scanning_get_variant_analysis_repo_task(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.ownerstringRequired within parent
path.repostringRequired within parent
path.codeql_variant_analysis_idintegerRequired within parent
path.repo_ownerstringRequired within parent
path.repo_namestringRequired within parent

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get the analysis status of a repository in a Code QL variant analysis — response body

Referenced models: Get the analysis status of a repository in a Code QL variant analysis — response body

Get the analysis status of a repository in a Code QL variant analysis — response body
FieldTypePresenceDescription and constraints
$objectRoot
analysis_statusstringRequired within parentThe new status of the CodeQL variant analysis repository task.
Known values: pending, in_progress, succeeded, failed, canceled, timed_out
artifact_size_in_bytesJSONOptional
artifact_size_in_bytes (anyOf 1)integerAlternativeThe size of the artifact. This is only available for successful analyses.
artifact_size_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
artifact_urlstringOptionalThe URL of the artifact. This is only available for successful analyses.
database_commit_shastringOptionalThe SHA of the commit the CodeQL database was built against. This is only available for successful analyses.
failure_messagestringOptionalThe reason of the failure of this repo task. This is only available if the repository task has failed.
repositoryModelRequired within parentExpand List repositories for a user migration — response body — item
result_countJSONOptional
result_count (anyOf 1)integerAlternativeThe number of results in the case of a successful analysis. This is only available for successful analyses.
result_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
source_location_prefixstringOptionalThe source location prefix to use. This is only available for successful analyses.

Referenced models: List repositories for a user migration — response body — item

List repositories for a user migration — response body — item
FieldTypePresenceDescription and constraints
$objectRootA GitHub repository.
archive_urlstringRequired within parentA template for the API URL to download the repository as an archive.
assignees_urlstringRequired within parentA template for the API URL to list the available assignees for issues in the repository.
blobs_urlstringRequired within parentA template for the API URL to create or retrieve a raw Git blob in the repository.
branches_urlstringRequired within parentA template for the API URL to get information about branches in the repository.
collaborators_urlstringRequired within parentA template for the API URL to get information about collaborators of the repository.
comments_urlstringRequired within parentA template for the API URL to get information about comments on the repository.
commits_urlstringRequired within parentA template for the API URL to get information about commits on the repository.
compare_urlstringRequired within parentA template for the API URL to compare two commits or refs.
contents_urlstringRequired within parentA template for the API URL to get the contents of the repository.
contributors_urlstringRequired within parentA template for the API URL to list the contributors to the repository.
Format: uri
deployments_urlstringRequired within parentThe API URL to list the deployments of the repository.
Format: uri
descriptionJSONRequired within parent
description (anyOf 1)stringAlternativeThe repository description.
description (anyOf 2)nullAlternative
downloads_urlstringRequired within parentThe API URL to list the downloads on the repository.
Format: uri
events_urlstringRequired within parentThe API URL to list the events of the repository.
Format: uri
forkbooleanRequired within parentWhether the repository is a fork.
forks_urlstringRequired within parentThe API URL to list the forks of the repository.
Format: uri
full_namestringRequired within parentThe full, globally unique, name of the repository.
git_commits_urlstringRequired within parentA template for the API URL to get information about Git commits of the repository.
git_refs_urlstringRequired within parentA template for the API URL to get information about Git refs of the repository.
git_tags_urlstringRequired within parentA template for the API URL to get information about Git tags of the repository.
hooks_urlstringRequired within parentThe API URL to list the hooks on the repository.
Format: uri
html_urlstringRequired within parentThe URL to view the repository on GitHub.com.
Format: uri
idJSONRequired within parent
id (anyOf 1)integerAlternativeA unique identifier of the repository.
Format: int64
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
issue_comment_urlstringRequired within parentA template for the API URL to get information about issue comments on the repository.
issue_events_urlstringRequired within parentA template for the API URL to get information about issue events on the repository.
issues_urlstringRequired within parentA template for the API URL to get information about issues on the repository.
keys_urlstringRequired within parentA template for the API URL to get information about deploy keys on the repository.
labels_urlstringRequired within parentA template for the API URL to get information about labels of the repository.
languages_urlstringRequired within parentThe API URL to get information about the languages of the repository.
Format: uri
merges_urlstringRequired within parentThe API URL to merge branches in the repository.
Format: uri
milestones_urlstringRequired within parentA template for the API URL to get information about milestones of the repository.
namestringRequired within parentThe name of the repository.
node_idstringRequired within parentThe GraphQL identifier of the repository.
notifications_urlstringRequired within parentA template for the API URL to get information about notifications on the repository.
ownerModelRequired within parentExpand List users — response body — item
privatebooleanRequired within parentWhether the repository is private.
pulls_urlstringRequired within parentA template for the API URL to get information about pull requests on the repository.
releases_urlstringRequired within parentA template for the API URL to get information about releases on the repository.
stargazers_urlstringRequired within parentThe API URL to list the stargazers on the repository.
Format: uri
statuses_urlstringRequired within parentA template for the API URL to get information about statuses of a commit.
subscribers_urlstringRequired within parentThe API URL to list the subscribers on the repository.
Format: uri
subscription_urlstringRequired within parentThe API URL to subscribe to notifications for this repository.
Format: uri
tags_urlstringRequired within parentThe API URL to get information about tags on the repository.
Format: uri
teams_urlstringRequired within parentThe API URL to list the teams on the repository.
Format: uri
trees_urlstringRequired within parentA template for the API URL to create or retrieve a raw Git tree of the repository.
urlstringRequired within parentThe URL to get more information about the repository from the GitHub API.
Format: uri

Referenced models: List users — response body — item

List users — response body — item
FieldTypePresenceDescription and constraints
$objectRootA GitHub user.
avatar_urlstringRequired within parentFormat: uri
emailJSONOptional
email (anyOf 1)stringAlternative
email (anyOf 2)nullAlternative
events_urlstringRequired within parent
followers_urlstringRequired within parentFormat: uri
following_urlstringRequired within parent
gists_urlstringRequired within parent
gravatar_idJSONRequired within parent
gravatar_id (anyOf 1)stringAlternative
gravatar_id (anyOf 2)nullAlternative
html_urlstringRequired within parentFormat: uri
idJSONRequired within parent
id (anyOf 1)integerAlternativeFormat: int64
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
loginstringRequired within parent
nameJSONOptional
name (anyOf 1)stringAlternative
name (anyOf 2)nullAlternative
node_idstringRequired within parent
organizations_urlstringRequired within parentFormat: uri
received_events_urlstringRequired within parentFormat: uri
repos_urlstringRequired within parentFormat: uri
site_adminbooleanRequired within parent
starred_atstringOptional
starred_urlstringRequired within parent
subscriptions_urlstringRequired within parentFormat: uri
typestringRequired within parent
urlstringRequired within parentFormat: uri
user_view_typestringOptional

SDK function policy ID: github.code_scanning_get_variant_analysis_repo_task. Catalog operation: code-scanning/get-variant-analysis-repo-task. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.