-
Notifications
You must be signed in to change notification settings - Fork 16
/
.changelog_template
70 lines (62 loc) · 2.94 KB
/
.changelog_template
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
{% if version.tag and from.tag -%}
## [{{ version.tag }}]({{repository_url ~ "/compare/" ~ from.tag ~ ".." ~ version.tag}}) - {{ date | date(format="%Y-%m-%d") }}
{% elif version.tag and from.id -%}
## [{{ version.tag }}]({{repository_url ~ "/compare/" ~ from.id ~ ".." ~ version.tag}}) - {{ date | date(format="%Y-%m-%d") }}
{% else -%}
{% set from = from.id -%}
{% set to = version.id -%}
{% set from_shorthand = from.id | truncate(length=7, end="") -%}
{% set to_shorthand = version.id | truncate(length=7, end="") -%}
## Unreleased ([{{ from_shorthand ~ ".." ~ to_shorthand }}]({{repository_url ~ "/compare/" ~ from_shorthand ~ ".." ~ to_shorthand}}))
{% endif -%}
{% for type, typed_commits in commits | sort(attribute="type")| group_by(attribute="type")-%}
#### {{ type | upper_first }}
{% for scope, scoped_commits in typed_commits | group_by(attribute="scope") -%}
{% for commit in scoped_commits | sort(attribute="scope") -%}
{% if commit.author and repository_url -%}
{% set author = "@" ~ commit.author -%}
{% set author_link = platform ~ "/" ~ commit.author -%}
{% set author = "[" ~ author ~ "](" ~ author_link ~ ")" -%}
{% else -%}
{% set author = commit.signature -%}
{% endif -%}
{% set commit_link = repository_url ~ "/commit/" ~ commit.id -%}
{% set shorthand = commit.id | truncate(length=7, end="") -%}
- **{{ scope }}:** {{ commit.summary }} ([{{shorthand}}]({{ commit_link }})) by {{ author }}
{% if commit.body -%}
{% set body = commit.body | replace(from="[skip ci]", to="") | replace(from="[skip-ci]", to="") | trim | spaceless -%}
{% set body_length = body | length -%}
{% if body_length > 0 -%}
{% if commit.breaking_changes -%}
- **BREAKING:** {{ body }}
{% else -%}
- {{ body }}
{% endif -%}
{% endif -%}
{%- endif %}
{% endfor -%}
{% endfor -%}
{% for commit in typed_commits | unscoped -%}
{% if commit.author and repository_url -%}
{% set author = "@" ~ commit.author -%}
{% set author_link = platform ~ "/" ~ commit.author -%}
{% set author = "[" ~ author ~ "](" ~ author_link ~ ")" -%}
{% else -%}
{% set author = commit.signature -%}
{% endif -%}
{% set commit_link = repository_url ~ "/commit/" ~ commit.id -%}
{% set shorthand = commit.id | truncate(length=7, end="") -%}
- {{ commit.summary }} ([{{shorthand}}]({{ commit_link }})) by {{ author }}
{% if commit.body -%}
{% set body = commit.body | replace(from="[skip ci]", to="") | replace(from="[skip-ci]", to="") | trim | spaceless -%}
{% set body_length = body | length -%}
{% if body_length > 0 -%}
{% if commit.breaking_changes -%}
- **BREAKING:** {{ body }}
{% else -%}
- {{ body }}
{% endif -%}
{% endif -%}
{%- endif %}
{% endfor -%}
{% endfor -%}