Skip to content

Commit 56708ef

Browse files
committed
chore: format contributors nicely in release notes
1 parent 2b8e2d9 commit 56708ef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.gitcliff.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ No notable changes.
2323
{% endfor %}
2424
2525
### Contributors
26-
{% for author, commits in commits | group_by(attribute="author") %}
26+
{% set contributors = commits | map(attribute="author") | unique %}
27+
{% if contributors | length == 0 %}
28+
- No new contributors for this release.
29+
{% else %}
30+
{% for author in contributors %}
2731
{% set author_name = author.name | default(value=author.email | default(value=author)) %}
28-
- {{ author_name }} ({{ commits | length }} commit{% if commits | length > 1 %}s{% endif %})
32+
{% set author_commits = commits | filter(attribute="author", value=author) %}
33+
- {{ author_name }} ({{ author_commits | length }} commit{% if author_commits | length > 1 %}s{% endif %})
2934
{% endfor %}
3035
{% endif %}
36+
{% endif %}
3137
"""
3238

3339
group_by = ["type"]

0 commit comments

Comments
 (0)