{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/github/main/json-schema/github-code-scanning-analysis-schema.json", "title": "code-scanning-analysis", "x-generated": "2026-10-03", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/github-code-scanning-api-openapi.yml#/components/schemas/code-scanning-analysis", "type": "object", "properties": { "ref": { "$ref": "#/$defs/code-scanning-ref" }, "commit_sha": { "$ref": "#/$defs/code-scanning-analysis-commit-sha" }, "analysis_key": { "$ref": "#/$defs/code-scanning-analysis-analysis-key" }, "environment": { "$ref": "#/$defs/code-scanning-analysis-environment" }, "category": { "$ref": "#/$defs/code-scanning-analysis-category" }, "error": { "type": "string" }, "created_at": { "$ref": "#/$defs/code-scanning-analysis-created-at" }, "results_count": { "type": "integer", "description": "The total number of results in the analysis." }, "rules_count": { "type": "integer", "description": "The total number of rules used in the analysis." }, "id": { "type": "integer", "description": "Unique identifier for this analysis." }, "url": { "$ref": "#/$defs/code-scanning-analysis-url" }, "sarif_id": { "$ref": "#/$defs/code-scanning-analysis-sarif-id" }, "tool": { "$ref": "#/$defs/code-scanning-analysis-tool" }, "deletable": { "type": "boolean" }, "warning": { "type": "string", "description": "Warning generated when processing the analysis" } }, "required": [ "ref", "commit_sha", "analysis_key", "environment", "error", "created_at", "results_count", "rules_count", "id", "url", "sarif_id", "tool", "deletable", "warning" ], "$defs": { "code-scanning-analysis-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." }, "code-scanning-analysis-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." }, "code-scanning-analysis-commit-sha": { "description": "The SHA of the commit to which the analysis you are uploading relates.", "type": "string", "minLength": 40, "maxLength": 40, "pattern": "^[0-9a-fA-F]+$" }, "code-scanning-analysis-created-at": { "type": "string", "description": "The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.", "format": "date-time", "readOnly": true }, "code-scanning-analysis-environment": { "type": "string", "description": "Identifies the variable values associated with the environment in which this analysis was performed." }, "code-scanning-analysis-sarif-id": { "type": "string", "description": "An identifier for the upload." }, "code-scanning-analysis-tool": { "type": "object", "properties": { "name": { "$ref": "#/$defs/code-scanning-analysis-tool-name" }, "version": { "$ref": "#/$defs/code-scanning-analysis-tool-version" }, "guid": { "$ref": "#/$defs/code-scanning-analysis-tool-guid" } } }, "code-scanning-analysis-tool-guid": { "type": [ "string", "null" ], "description": "The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data." }, "code-scanning-analysis-tool-name": { "type": "string", "description": "The name of the tool used to generate the code scanning analysis." }, "code-scanning-analysis-tool-version": { "type": [ "string", "null" ], "description": "The version of the tool used to generate the code scanning analysis." }, "code-scanning-analysis-url": { "type": "string", "description": "The REST API URL of the analysis resource.", "format": "uri", "readOnly": true }, "code-scanning-ref": { "type": "string", "description": "The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,\n`refs/heads/` or simply ``." } } }