From cdfeede217d2836decd7c53c92e5bcb01893964d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 17 Feb 2024 11:08:36 -0500 Subject: [PATCH] Upgrading git cliff init. (#729) --- cliff.toml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cliff.toml b/cliff.toml index ddb90815..88e934ae 100644 --- a/cliff.toml +++ b/cliff.toml @@ -13,6 +13,8 @@ body = """ # Thumb-Key {{ version }} ({{ timestamp | date(format="%Y-%m-%d") }}) ## What's Changed + +{%- if version %} in {{ version }}{%- endif -%} {% for commit in commits %} {% if commit.github.pr_title -%} {%- set commit_message = commit.github.pr_title -%} @@ -21,7 +23,9 @@ body = """ {%- endif -%} * {{ commit_message | split(pat="\n") | first | trim }}\ {% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%} - {% if commit.github.pr_number %} in #{{ commit.github.pr_number }}{%- endif %} + {% if commit.github.pr_number %} in \ + [#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \ + {%- endif %} {%- endfor -%} {% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} @@ -29,16 +33,23 @@ body = """ ## New Contributors {%- endif %}\ {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} - * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }} + * @{{ contributor.username }} made their first contribution + {%- if contributor.pr_number %} in \ + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ + {%- endif %} {%- endfor -%} {% if version %} {% if previous.version %} - **Full Changelog**: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/compare/{{ previous.version }}...{{ version }} + **Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }} {% endif %} {% else -%} {% raw %}\n{% endraw %} {% endif %} + +{%- macro remote_url() -%} + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} +{%- endmacro -%} """ # remove the leading and trailing whitespace from the template trim = true