Skip to content

Commit 0d76fc1

Browse files
committed
fix(release): 🐛 list contributors even when GitHub can't resolve a login
The previous fix stopped the changelog crash but left the section empty whenever github.contributors' username is null for everyone (e.g. v1.2.0 -- commit author email isn't linked to a verified GitHub account, so the API never resolves a login). Source the list from commits' own author.name instead (always present), deduped, still preferring @username when a commit's github.username did resolve.
1 parent e80b420 commit 0d76fc1

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cliff.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ body = """
88
- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}{{ commit.message | split(pat="\n") | first }}
99
{% endfor %}
1010
{% endfor %}\
11-
{% if github.contributors | length > 0 %}
11+
{% set contributor_commits = commits | unique(attribute="author.name") %}
12+
{% if contributor_commits | length > 0 %}
1213
### 👥 Contributors
1314
14-
{% for contributor in github.contributors %}\
15-
{% if contributor.username %}* @{{ contributor.username }}
15+
{% for c in contributor_commits %}\
16+
{% if c.github.username %}* @{{ c.github.username }}
17+
{% else %}* {{ c.author.name }}
1618
{% endif %}\
1719
{% endfor %}
1820
{% endif %}\

0 commit comments

Comments
 (0)