> In GitLab 11.7, support for including [GitLab-supplied templates](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/lib/gitlab/ci/templates) directly [was added](https://gitlab.com/gitlab-org/gitlab-ce/issues/53445).
> In GitLab 11.7, support for [including GitLab-supplied templates directly](https://gitlab.com/gitlab-org/gitlab-ce/issues/53445) and support for [including templates from another repository](https://gitlab.com/gitlab-org/gitlab-ce/issues/53903) was added.
Using the `include` keyword, you can allow the inclusion of external YAML files.
Using the `include` keyword, you can allow the inclusion of external YAML files.
...
@@ -1724,7 +1724,7 @@ include:
...
@@ -1724,7 +1724,7 @@ include:
---
---
`include` supports three types of files:
`include` supports four types of files:
-**local** to the same repository, referenced by using full paths in the same
-**local** to the same repository, referenced by using full paths in the same
repository, with `/` being the root directory. For example:
repository, with `/` being the root directory. For example:
...
@@ -1750,6 +1750,32 @@ include:
...
@@ -1750,6 +1750,32 @@ include:
NOTE: **Note:**
NOTE: **Note:**
We don't support the inclusion of local files through Git submodules paths.
We don't support the inclusion of local files through Git submodules paths.
-**file** from another repository, referenced by using full paths in the same
repository, with `/` being the root directory. For example:
```yaml
include:
project: 'my-group/my-project'
file: '/templates/.gitlab-ci-template.yml'
```
You can also specify `ref:`. The default `ref:` is the `HEAD` of the project: