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 | The ID or URL- |
shaQuery | String | Deprecated:content_ |
content_Query | String | The CI/sha |
dry_Query | Boolean | Run pipeline creation simulation, Default: false |
include_Query | Boolean | If the list of jobs that would exist in a static check or pipeline simulation should be included in the response. |
refQuery | String | Deprecated:dry_ |
dry_Query | String | Branch or tag used as context when executing a dry run.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 | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
contentRequired | String | Content of . |
dry_ | Boolean | Run pipeline creation simulation, Default: false |
include_ | Boolean | If the list of jobs that would exist in a static check or pipeline simulation should be included in the response. |
ref | String | When dry_ |
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 |