Can I use “.gitlab-ci.yaml” instead of “.gitlab-ci.yml”?

The GitLab CI/CD tutorial says that you need to create a file named “.gitlab-ci.yml”. According to the IANA Media Types list, both “yaml” and “yml” are valid file extensions for YAML files, but “yaml” is the preferred one. Additionally, I personally prefer using “.yaml” instead of “.yml” because it’s more clear and consistent (there are some places where I have to use “.yaml” and can’t use “.yml”).

Does GitLab CI/CD support using “.gitlab-ci.yaml” instead of “.gitlab-ci.yml”?

It is possible, but from my own experience I do not recommend it – as it makes importing external projects with a .gitlab-ci.yml file more complicated, not following the changed default.

Admins can set a default configuration path on the instance level, and individual projects can override it. See the docs for details on the settings locations.

1 Like