Skip to content

Validate existing CI/CD configuration

GET
/api/v4/projects/{id}/ci/lint

Validates the .gitlab-ci.yml configuration for a specified project.

id
required
One of:
string

The ID or URL-encoded path of the project

sha
string
nullable

Deprecated: Use content_ref instead

content_ref
string
nullable

The CI/CD configuration content is taken from this commit SHA, branch or tag. Defaults to the HEAD of the project’s default branch

dry_run
boolean
nullable

Run pipeline creation simulation, or only do static check. This is false by default

include_jobs
boolean
nullable

If the list of jobs that would exist in a static check or pipeline simulation should be included in the response. This is false by default

ref
string
nullable

Deprecated: Use dry_run_ref instead

dry_run_ref
string
nullable

Branch or tag used as context when executing a dry run. Defaults to the default branch of the project. Only used when dry_run is true

OK

Media type application/json
object
valid
boolean
errors
Array<string>
warnings
Array<string>
merged_yaml
string
includes
Array<object>
object
type
string
location
string
blob
string
raw
string
extra
object
context_project
string
context_sha
string
jobs
Array<object>
object
Example
{
"errors": [
"variables config should be a hash of key value pairs"
],
"warnings": [
"jobs:job may allow multiple pipelines ..."
],
"merged_yaml": "---\\n:another_test:\\n :stage: test\\n\n :script: echo 2\\n:test:\\n :stage: test\\n :script: echo 1\\n",
"includes": [
{
"blob": "https://gitlab.com/root/example-project/-/blob/..."
}
],
"jobs": [
{
"name": "test",
"script": [
"ls"
]
}
]
}

Bad Request

Not found