Skip to content

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.

id
required
One of:
string

The ID or URL-encoded path of the project

Media type application/json
object
content
required

Content of .gitlab-ci.yml

string
nullable
dry_run

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

boolean
nullable
include_jobs

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

boolean
nullable
ref

When dry_run is true, sets the branch or tag to use. Defaults to the project’s default branch when not set

string
nullable
Example generated
{
"content": "example",
"dry_run": true,
"include_jobs": true,
"ref": "example"
}

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