# code-scanning-analysis

From **GitHub v3 REST API**.

- Type: `object`

## Properties

### `analysis_key`

- Required: true
- Type: `string`

Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.

### `category`

- Required: false
- Type: `string`

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.

### `commit_sha`

- Required: true
- Type: `string`
- minLength: `40`
- maxLength: `40`
- pattern: `^[0-9a-fA-F]+$`

The SHA of the commit to which the analysis you are uploading relates.

### `created_at`

- Required: true
- Type: `string`
- Format: `date-time`

The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.

### `deletable`

- Required: true
- Type: `boolean`

### `environment`

- Required: true
- Type: `string`

Identifies the variable values associated with the environment in which this analysis was performed.

### `error`

- Required: true
- Type: `string`
- Example: `error reading field xyz`

### `id`

- Required: true
- Type: `integer`

Unique identifier for this analysis.

### `ref`

- Required: true
- Type: `string`

The full Git reference, formatted as `refs/heads/<branch name>`,
`refs/pull/<number>/merge`, or `refs/pull/<number>/head`.

### `results_count`

- Required: true
- Type: `integer`

The total number of results in the analysis.

### `rules_count`

- Required: true
- Type: `integer`

The total number of rules used in the analysis.

### `sarif_id`

- Required: true
- Type: `string`
- Example: `6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53`

An identifier for the upload.

### `tool`

- Required: true
- Type: `object`

### `tool_name`

- Required: false
- Type: `string`

### `url`

- Required: true
- Type: `string`
- Format: `uri`

The REST API URL of the analysis resource.

### `warning`

- Required: true
- Type: `string`
- Example: `123 results were ignored`

Warning generated when processing the analysis

## JSON Schema

```json
{"properties":{"analysis_key":{"$ref":"#/components/schemas/code-scanning-analysis-analysis-key"},"category":{"$ref":"#/components/schemas/code-scanning-analysis-category"},"commit_sha":{"$ref":"#/components/schemas/code-scanning-analysis-commit-sha"},"created_at":{"$ref":"#/components/schemas/code-scanning-analysis-created-at"},"deletable":{"type":"boolean"},"environment":{"$ref":"#/components/schemas/code-scanning-analysis-environment"},"error":{"example":"error reading field xyz","type":"string"},"id":{"description":"Unique identifier for this analysis.","type":"integer"},"ref":{"$ref":"#/components/schemas/code-scanning-ref"},"results_count":{"description":"The total number of results in the analysis.","type":"integer"},"rules_count":{"description":"The total number of rules used in the analysis.","type":"integer"},"sarif_id":{"$ref":"#/components/schemas/code-scanning-analysis-sarif-id"},"tool":{"$ref":"#/components/schemas/code-scanning-analysis-tool"},"tool_name":{"type":"string"},"url":{"$ref":"#/components/schemas/code-scanning-analysis-url"},"warning":{"description":"Warning generated when processing the analysis","example":"123 results were ignored","type":"string"}},"required":["ref","commit_sha","analysis_key","environment","error","created_at","results_count","rules_count","id","url","sarif_id","tool","deletable","warning"],"type":"object"}
```
