Skip to content

Commit

Permalink
docs(website): add get_env filter example for GitLab CI
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Sep 26, 2024
1 parent d7b2d03 commit dfe4459
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions website/docs/integration/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 6 additions & 0 deletions website/docs/tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
```

0 comments on commit dfe4459

Please sign in to comment.