Use this API to validate a GitLab CI/CD configuration.
These endpoints take JSON-encoded YAML content. To preserve the formatting of your CI/CD
configuration, it can help to escape and encode the YAML with a third-party tool such as
jq before you make the request.
Validate existing CI/CD configuration
GET /api/v4/projects/{id}/ci/lint
Validates the .gitlab-ci.yml configuration for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
shaQuery | String | Commit SHA,content_ instead.content_ |
content_Query | String | Commit SHA,sha |
dry_Query | Boolean | If true,false,Default: false |
include_Query | Boolean | If true, |
refQuery | String | If dry_ is true,dry_ instead.dry_ |
dry_Query | String | If dry_ is true,ref |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not found | — |
Validate a CI/CD configuration
POST /api/v4/projects/{id}/ci/lint
Validates a provided CI/CD configuration in the context of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
contentRequired | String | CI/ |
dry_ | Boolean | If true,false,Default: false |
include_ | Boolean | If true, |
ref | String | If dry_ is true, |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCiLintResult
| Property | Type | Description |
|---|---|---|
errors | Array of strings | Example:["variables config should be a hash of key value pairs"] |
includes | Array of APIEntities | Example:[{"blob": |
jobs | Array of objects | Example:[{"name": |
merged_ | String | Example:- |
valid | Boolean | — |
warnings | Array of strings | Example:["jobs: |
APIEntitiesCiLintResultInclude
| Property | Type | Description |
|---|---|---|
blob | String | Example:https: |
context_ | String | Example:gitlab- |
context_ | String | Example:e52d6d0246d737529185 |
extra | Object | Example:{"job_ |
location | String | Example:. |
raw | String | Example:https: |
type | String | Example:local |