-
-
Notifications
You must be signed in to change notification settings - Fork 317
Expand file tree
/
Copy pathgitlab.toml
More file actions
90 lines (82 loc) · 3.31 KB
/
Copy pathgitlab.toml
File metadata and controls
90 lines (82 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
# [remote.gitlab]
# owner = "orhun"
# repo = "git-cliff"
# token = ""
[changelog]
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
body = """
## What's Changed
{%- if version %} in {{ version | trim_start_matches(pat="v") }}{%- endif -%}
{% for commit in commits %}
{% if commit.remote.pr_title -%}
{%- set commit_message = commit.remote.pr_title -%}
{%- else -%}
{%- set commit_message = commit.message -%}
{%- endif -%}
* {{ commit_message | split(pat="\n") | first | trim }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
{% if commit.remote.pr_number %} in \
[!{{ commit.remote.pr_number }}]({{ self::project_url() }}/-/merge_requests/{{ commit.remote.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- if gitlab -%}
{% if gitlab.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
### New Contributors
{%- endif %}\
{% for contributor in gitlab.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[!{{ contributor.pr_number }}]({{ self::project_url() }}/-/merge_requests/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- endif -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::project_url() }}/-/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro project_url() -%}
{%- set ci_project_url = get_env(name="CI_PROJECT_URL", default="") -%}
{%- if ci_project_url != "" -%}
{{ ci_project_url }}
{%- elif remote.gitlab.api_url and remote.gitlab.owner and remote.gitlab.repo -%}
{{ remote.gitlab.api_url | trim_end_matches(pat="/api/v4") }}/{{ remote.gitlab.owner }}/{{ remote.gitlab.repo }}
{%- elif remote.gitlab.owner and remote.gitlab.repo -%}
https://gitlab.com/{{ remote.gitlab.owner }}/{{ remote.gitlab.repo }}
{%- else -%}
{%- endif -%}
{%- endmacro -%}
"""
# Remove leading and trailing whitespaces from the changelog's body.
trim = true
# A Tera template to be rendered as the changelog's footer.
# See https://keats.github.io/tera/docs/#introduction
footer = """
<!-- generated by git-cliff -->
"""
# An array of regex based postprocessors to modify the changelog.
# Replace the placeholder `<REPO>` with a URL.
postprocessors = []
[git]
# Parse commits according to the conventional commits specification.
# See https://www.conventionalcommits.org
conventional_commits = false
# Exclude commits that do not match the conventional commits specification.
filter_unconventional = true
# Split commits on newlines, treating each line as an individual commit.
split_commits = false
# An array of regex based parsers to modify commit messages prior to further processing.
commit_preprocessors = [{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }]
# Exclude commits that are not matched by any commit parser.
filter_commits = false
# Order releases topologically instead of chronologically.
topo_order = false
# Order of commits in each group/release within the changelog.
# Allowed values: newest, oldest
sort_commits = "newest"