ci_lint

Validate a CI/CD configuration

Validates a provided CI/CD configuration in the context of a specified project.

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

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Request body

contentstring required

Content of .gitlab-ci.yml

dry_runboolean

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

include_jobsboolean

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

refstring

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

Response

Validate a CI/CD configuration

validboolean required
errorsstring[] required
warningsstring[] required
merged_yamlstring required
jobsobject[]

Example response

{
  "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"
      ]
    }
  ]
}

Changes

No recorded changes to this operation across all 5 revisions of this API.