|
| 1 | +# git-cliff ~ configuration file |
| 2 | +# https://git-cliff.org/docs/configuration |
| 3 | + |
| 4 | +# [remote.github] |
| 5 | +# owner = "orhun" |
| 6 | +# repo = "git-cliff" |
| 7 | +# token = "" |
| 8 | + |
| 9 | +[changelog] |
| 10 | +# template for the changelog body |
| 11 | +# https://keats.github.io/tera/docs/#introduction |
| 12 | +body = """ |
| 13 | +## What's Changed |
| 14 | +
|
| 15 | +{%- if version %} in {{ version }}{%- endif -%} |
| 16 | +{% for commit in commits %} |
| 17 | + {% if commit.github.pr_title -%} |
| 18 | + {%- set commit_message = commit.github.pr_title -%} |
| 19 | + {%- else -%} |
| 20 | + {%- set commit_message = commit.message -%} |
| 21 | + {%- endif -%} |
| 22 | + * {{ commit_message | split(pat="\n") | first | trim }}\ |
| 23 | + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%} |
| 24 | + {% if commit.github.pr_number %} in \ |
| 25 | + [#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \ |
| 26 | + {%- endif %} |
| 27 | +{%- endfor -%} |
| 28 | +
|
| 29 | +{%- if github -%} |
| 30 | +{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} |
| 31 | + {% raw %}\n{% endraw -%} |
| 32 | + ## New Contributors |
| 33 | +{%- endif %}\ |
| 34 | +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} |
| 35 | + * @{{ contributor.username }} made their first contribution |
| 36 | + {%- if contributor.pr_number %} in \ |
| 37 | + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ |
| 38 | + {%- endif %} |
| 39 | +{%- endfor -%} |
| 40 | +{%- endif -%} |
| 41 | +
|
| 42 | +{% if version %} |
| 43 | + {% if previous.version %} |
| 44 | + **Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }} |
| 45 | + {% endif %} |
| 46 | +{% else -%} |
| 47 | + {% raw %}\n{% endraw %} |
| 48 | +{% endif %} |
| 49 | +
|
| 50 | +{%- macro remote_url() -%} |
| 51 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 52 | +{%- endmacro -%} |
| 53 | +""" |
| 54 | +# remove the leading and trailing whitespace from the template |
| 55 | +trim = true |
| 56 | +# changelog footer |
| 57 | +footer = """ |
| 58 | +<!-- generated by git-cliff --> |
| 59 | +""" |
| 60 | +# postprocessors |
| 61 | +postprocessors = [] |
| 62 | + |
| 63 | +[git] |
| 64 | +# parse the commits based on https://www.conventionalcommits.org |
| 65 | +conventional_commits = false |
| 66 | +# filter out the commits that are not conventional |
| 67 | +filter_unconventional = true |
| 68 | +# process each line of a commit as an individual commit |
| 69 | +split_commits = false |
| 70 | +# regex for preprocessing the commit messages |
| 71 | +commit_preprocessors = [ |
| 72 | + # remove issue numbers from commits |
| 73 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, |
| 74 | +] |
| 75 | +# protect breaking changes from being skipped due to matching a skipping commit_parser |
| 76 | +protect_breaking_commits = false |
| 77 | +# filter out the commits that are not matched by commit parsers |
| 78 | +filter_commits = false |
| 79 | +# regex for matching git tags |
| 80 | +tag_pattern = "v[0-9].*" |
| 81 | +# regex for skipping tags |
| 82 | +skip_tags = "beta|alpha" |
| 83 | +# regex for ignoring tags |
| 84 | +ignore_tags = "rc" |
| 85 | +# sort the tags topologically |
| 86 | +topo_order = false |
| 87 | +# sort the commits inside sections by oldest/newest order |
| 88 | +sort_commits = "newest" |
0 commit comments