Skip to content

Commit 659b4ca

Browse files
authored
fix: handle non conventional commits (#571)
1 parent cbc2eb6 commit 659b4ca

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.cargo/release-plz.toml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ body = """
3737
{% for group, group_commits in commits | filter(attribute="remote.pr_number") | sort(attribute="remote.pr_number") | reverse | group_by(attribute="group") %}
3838
### {{ group | striptags | trim | upper_first }}
3939
40-
{% for commit in group_commits | sort(attribute="breaking") | reverse %}
41-
{%- if commit.scope -%}
42-
- {% if commit.breaking %}[**breaking**] {% endif %}*({{commit.scope}})* \
43-
{{ commit.message | upper_first }}{{ self::username(commit=commit) }}
44-
{% else -%}
45-
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}{{ self::username(commit=commit) }}
40+
{% for commit in group_commits %}
41+
{%- if commit.breaking -%}{{ self::commit_line(commit=commit) }}
42+
{% endif -%}
43+
{% endfor -%}
44+
{% for commit in group_commits %}
45+
{%- if not commit.breaking -%}{{ self::commit_line(commit=commit) }}
4646
{% endif -%}
4747
{% endfor -%}
4848
{% endfor %}
@@ -54,6 +54,15 @@ body = """
5454
{%- macro username(commit) -%}
5555
{% if commit.remote.username %} (by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }})){% endif -%}
5656
{% endmacro -%}
57+
{%- macro commit_line(commit) -%}
58+
- {% if commit.breaking %}
59+
[**breaking**]
60+
{% endif %}
61+
{% if commit.scope %}
62+
*({{commit.scope}})*
63+
{% endif %}
64+
{{ commit.message | upper_first }}{{ self::username(commit=commit) }}
65+
{%- endmacro -%}
5766
"""
5867

5968
protect_breaking_commits = true

0 commit comments

Comments
 (0)