summaryrefslogtreecommitdiff
path: root/doc/api/ci_lint.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/ci_lint.md')
-rw-r--r--doc/api/ci_lint.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/doc/api/ci_lint.md b/doc/api/ci_lint.md
new file mode 100644
index 00000000000..2b169176dd6
--- /dev/null
+++ b/doc/api/ci_lint.md
@@ -0,0 +1,45 @@
+# Validate the .gitlab-ci.yaml
+
+Check whether your .gitlab-ci.yml file is valid.
+
+```
+POST ci/lint
+```
+
+| Attribute | Type | Required | Description |
+| ---------- | ------- | -------- | -------- |
+| `content` | hash | yes | the .gitlab-ci.yaml content|
+
+```bash
+curl --request POST "https://gitlab.example.com/api/v3/ci/lint?content=YAML+Content"
+```
+
+Example response:
+
+* valid content
+
+```json
+{
+ "status": "valid",
+ "errors": []
+}
+```
+
+* invalid content
+
+```json
+{
+ "status": "invalid",
+ "errors": [
+ "variables config should be a hash of key value pairs"
+ ]
+}
+```
+
+* without the content attribute
+
+```json
+{
+ "error": "content is missing"
+}
+```