Code Issues Pull Requests Actions Packages Projects Releases 15 Wiki Activity Security Code Quality
Files
global-workflow/cliff.toml
T

79 lines
3.4 KiB
TOML

# git-cliff configuration — https://git-cliff.org/docs/configuration
# Preview locally: npx git-cliff --latest (or: npx git-cliff v0.6.1..v0.7.0)
[changelog]
header = ""
# Group names carry an HTML comment prefix so sections sort in a fixed order; `striptags` removes it when rendering.
body = """
{%- set server = get_env(name="GITHUB_SERVER_URL", default="") -%}
{%- set repository = get_env(name="GITHUB_REPOSITORY", default="") -%}
{% if version %}\
# Release Notes for {{ version }}
{% else %}\
# Unreleased
{% endif %}
{%- set breaking_commits = commits | filter(attribute="breaking", value=true) %}
{% if breaking_commits | length > 0 %}
## :warning: Breaking changes
{% for commit in breaking_commits %}
- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}{{ commit.breaking_description | default(value=commit.message) | upper_first }} ({{ commit.id | truncate(length=7, end="") }})
{%- endfor %}
{% endif %}
{%- for group, group_commits in commits | group_by(attribute="group") %}
## {{ group | striptags | trim }}
{% for commit in group_commits %}
- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}{{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end="") }})
{%- endfor %}
{% endfor %}
{#- Author names vary per machine (tienbh / Tien-BH / ...); the email local part matches the Gitea username. -#}
{%- set_global usernames = [] %}
{%- for commit in commits %}
{%- set username = commit.author.email | split(pat="@") | first | lower %}
{%- if username and username is not containing("bot") and username != "github-actions" and not username in usernames %}
{%- set_global usernames = usernames | concat(with=username) %}
{%- endif %}
{%- endfor %}
{% if usernames | length > 0 %}
## Contributors
{% for username in usernames | sort %}
* @{{ username }}
{%- endfor %}
{% endif %}
{% if server and repository and version %}
{%- if previous.version %}
**Full Changelog**: [{{ previous.version }}...{{ version }}]({{ server }}/{{ repository }}/compare/{{ previous.version }}...{{ version }})
{%- else %}
**Full Changelog**: [{{ version }}]({{ server }}/{{ repository }}/commits/tag/{{ version }})
{%- endif %}
{% endif %}
"""
footer = ""
trim = true
postprocessors = [
{ pattern = '\n{3,}', replace = "\n\n" },
]
[git]
conventional_commits = true
# Drops merge/squash commits such as "Develop (!259)" or "Merge Develop into Main (!250)".
filter_unconventional = true
split_commits = false
protect_breaking_commits = true
filter_commits = false
tag_pattern = "v[0-9].*"
sort_commits = "newest"
commit_parsers = [
{ message = "^(?i)merge", skip = true },
{ message = "^(?i)feat", group = "<!-- 0 -->:rocket: Features" },
{ message = "^(?i)(fix|hotfix)", group = "<!-- 1 -->:bug: Bug Fixes" },
{ message = "^(?i)(improve|enhancement|perf)", group = "<!-- 2 -->:zap: Improvements" },
{ message = "^(?i)refactor", group = "<!-- 3 -->:recycle: Refactor" },
{ message = "^(?i)migration", group = "<!-- 4 -->:card_file_box: Database Migrations" },
{ message = "^(?i)docs?", group = "<!-- 5 -->:memo: Documentation" },
{ message = "^(?i)style", group = "<!-- 6 -->:art: Styling" },
{ message = "^(?i)test", group = "<!-- 7 -->:white_check_mark: Tests" },
{ message = "^(?i)(ci|build)", group = "<!-- 8 -->:construction_worker: CI/CD" },
{ message = "^(?i)chore", group = "<!-- 9 -->:wrench: Chores" },
{ message = ".*", group = "<!-- 10 -->:card_index: Other" },
]