Skip to content

Commit

Permalink
chore: add pr detection to git cliff contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
tqwewe committed Oct 9, 2024
1 parent ce4c73b commit 1f800bd
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@ body = """
## [Unreleased]
{% endif -%}
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }}
{%- endfor -%}
{%- if github.contributors | length > 0 %}
{% endif -%}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in #{{ contributor.pr_number -}}
{%- else -%}
{#- find the commit -#}
{% for commit in commits -%}
{%- if commit.id == commit_id -%}
{%- set pr = commit.message | split(pat="#") | last | trim_end_matches(pat=")") -%}
{%- if pr is matching("^\\d+$") %} in #{{ pr }}{%- endif -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor %}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits | sort(attribute="author.timestamp") | reverse | sort(attribute="breaking") | reverse %}
Expand Down

0 comments on commit 1f800bd

Please sign in to comment.