GitLab CI YAML configuration linting

If you want to test the validity of a GitLab CI YAML configuration before committing it to the repository, GitLab provides a built-in linting tool that allows checking for syntax/logical errors.

You may have seen »Found errors in your .gitlab-ci.yml« error messages after adding changes to your GitLab CI configuration due to YAML syntax errors, typos, or wrong properties and ask yourself whether there’s a way to validate your CI configuration changes.

To ease troubleshooting and prevent errors such as typos or invalid configuration properties in the first place, GitLab CI’s linting tool can be of great help. To access that »CI Lint« tool, navigate to »CI/CD« → »Pipelines« in your repository and choose »CI Lint«.

Now, you can write/paste your CI configuration in there and validate it. GitLab also allows to emulate pipelines based on that configuration.