Skip to content

Commit

Permalink
Update cliff.template.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig authored Mar 12, 2024
1 parent aa55923 commit 9dd6846
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions workflow-templates/cliff.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,45 @@ header = """
# body - see https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
## [{{ version | trim_start_matches(pat="v") }}]\
{% if previous %}\
{% if previous.version %}\
(REPOSITORY_URL/compare/{{ previous.version }}...{{ version }})\
{% else %}\
(REPOSITORY_URL/tree/{{ version }})\
{% endif %}\
{% endif %}\
- ({{ timestamp | date(format="%Y-%m-%d") }})
{% else %}\
## [Unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
## {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}\
**{{commit.scope}}:** \
{% endif %}\
{% if '```' in commit.message %}\
{{ commit.message | upper_first }}\n\
([{{ commit.id | truncate(length=7, end="") }}](REPOSITORY_URL/commit/{{ commit.id }})) - ({{ commit.author.name }})\
{% else %}\
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](REPOSITORY_URL/commit/{{ commit.id }})) - ({{ commit.author.name }})\
{% endif %}\
{% if commit.breaking %}\
{% for breakingChange in commit.footers %}\
\n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\
{% endfor %}\
{% endif %}\
{% endfor %}
{% endfor %}\n
"""

# footer
footer = """
***
*Changelog generated by [git-cliff](https://github.com/orhun/git-cliff).*
***
"""

# commits
[git]
conventional_commits = true
filter_unconventional = true
Expand All @@ -50,7 +69,8 @@ split_commits = false
protect_breaking_commits = true
# limit_commits = 42
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))" },
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](REPOSITORY_URL/issues/${2}))"},
{ pattern = "Merge pull request #([0-9]+) from [^ ]+", replace = "PR [#${1}](REPOSITORY_URL/pull/${1}):"},
]
commit_parsers = [
{ message = "^feat", group = "Features" },
Expand Down

0 comments on commit 9dd6846

Please sign in to comment.