# 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 = ":rocket: Features" }, { message = "^(?i)(fix|hotfix)", group = ":bug: Bug Fixes" }, { message = "^(?i)(improve|enhancement|perf)", group = ":zap: Improvements" }, { message = "^(?i)refactor", group = ":recycle: Refactor" }, { message = "^(?i)migration", group = ":card_file_box: Database Migrations" }, { message = "^(?i)docs?", group = ":memo: Documentation" }, { message = "^(?i)style", group = ":art: Styling" }, { message = "^(?i)test", group = ":white_check_mark: Tests" }, { message = "^(?i)(ci|build)", group = ":construction_worker: CI/CD" }, { message = "^(?i)chore", group = ":wrench: Chores" }, { message = ".*", group = ":card_index: Other" }, ]