Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f72654c6
Commit
f72654c6
authored
Nov 06, 2020
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation for endpoint
parent
05225bfd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
doc/api/lint.md
doc/api/lint.md
+48
-0
No files found.
doc/api/lint.md
View file @
f72654c6
...
@@ -99,6 +99,54 @@ Example response:
...
@@ -99,6 +99,54 @@ Example response:
}
}
```
```
## Validate a CI YAML configuration with a namespace
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/231352) in GitLab 13.6.
Checks if CI/CD YAML configuration is valid. This endpoint has namespace
specific context.
```
plaintext
POST /projects/:id/ci/lint
```
| Attribute | Type | Required | Description |
| ---------- | ------- | -------- | -------- |
|
`content`
| string | yes | The CI/CD configuration content. |
|
`dry_run`
| boolean | no | Run
[
pipeline creation simulation
](
../ci/lint.md#pipeline-simulation
)
, or only do static check. This is false by default. |
Example request:
```
shell
curl
--header
"Content-Type: application/json"
"https://gitlab.example.com/api/v4/projects/:id/ci/lint"
--data
'{"content": "{ \"image\": \"ruby:2.6\", \"services\": [\"postgres\"], \"before_script\": [\"bundle install\", \"bundle exec rake db:create\"], \"variables\": {\"DB_NAME\": \"postgres\"}, \"types\": [\"test\", \"deploy\", \"notify\"], \"rspec\": { \"script\": \"rake spec\", \"tags\": [\"ruby\", \"postgres\"], \"only\": [\"branches\"]}}"}'
```
Example responses:
-
Valid configuration:
```
json
{
"valid"
:
true
,
"merged_yaml"
:
"---
\n
:test_job:
\n
:script: echo 1
\n
"
,
"errors"
:
[],
"warnings"
:
[]
}
```
-
Invalid configuration:
```
json
{
"valid"
:
false
,
"merged_yaml"
:
"---
\n
:test_job:
\n
:script: echo 1
\n
"
,
"errors"
:
[
"jobs config should contain at least one visible job"
],
"warnings"
:
[]
}
```
## Validate a project's CI configuration
## Validate a project's CI configuration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/231352) in GitLab 13.5.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/231352) in GitLab 13.5.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment