1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-11-25 13:13:39 +03:00

docs(website): add get_env filter example for GitLab CI

This commit is contained in:
Orhun Parmaksız 2024-09-26 11:23:56 +03:00
parent d7b2d031c4
commit dfe4459c5c
No known key found for this signature in database
GPG Key ID: F83424824B3E4B90
2 changed files with 16 additions and 0 deletions

View File

@ -94,6 +94,16 @@ For example:
https://gitlab.com/{{ remote.gitlab.owner }}/{{ remote.gitlab.repo }}/-/tags/{{ version }}
```
:::tip
If you are using GitLab CI, you can use [`CI_PROJECT_URL`](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html) environment variable instead:
```jinja2
{{ get_env(name="CI_PROJECT_URL") }}/-/tags/{{ version }}
```
:::
### Commit authors
For each commit, GitLab related values are added as a nested object (named `gitlab`) to the [template context](/docs/templating/context):

View File

@ -84,3 +84,9 @@ commit_parsers = [
{ field = "github.pr_labels", pattern = ".*", group = "<!-- 6 --> 🌀 Miscellaneous" },
]
```
## Use GitLab CI variables
```jinja2
{{ get_env(name="CI_PROJECT_URL") }}/-/tags/{{ version }}
```