Skip to content

Commit 6f38deb

Browse files
committed
chore: simplify contributor listing to avoid unique filter
1 parent 56708ef commit 6f38deb

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.gitcliff.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ No notable changes.
2323
{% endfor %}
2424
2525
### Contributors
26-
{% set contributors = commits | map(attribute="author") | unique %}
27-
{% if contributors | length == 0 %}
26+
{% if commits | length == 0 %}
2827
- No new contributors for this release.
2928
{% else %}
30-
{% for author in contributors %}
31-
{% set author_name = author.name | default(value=author.email | default(value=author)) %}
32-
{% set author_commits = commits | filter(attribute="author", value=author) %}
33-
- {{ author_name }} ({{ author_commits | length }} commit{% if author_commits | length > 1 %}s{% endif %})
29+
{% for author_name, author_commits in commits | group_by(attribute="author.name") %}
30+
{% set author_email = (author_commits | first).author.email %}
31+
{% set display_name = author_name | default(value=author_email) %}
32+
- {{ display_name }} ({{ author_commits | length }} commit{% if author_commits | length > 1 %}s{% endif %})
3433
{% endfor %}
3534
{% endif %}
36-
{% endif %}
3735
"""
3836

3937
group_by = ["type"]

0 commit comments

Comments
 (0)