From 683e028b5791935f706251e4cb042183569992dd Mon Sep 17 00:00:00 2001 From: Alexander Gil Date: Tue, 31 Mar 2026 02:10:31 +0200 Subject: [PATCH] feat: add git cliff support for github squash commits --- cliff.toml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/cliff.toml b/cliff.toml index 56ff00e..d024479 100644 --- a/cliff.toml +++ b/cliff.toml @@ -49,9 +49,24 @@ footer = """ # parse the commits based on https://www.conventionalcommits.org conventional_commits = true # filter out the commits that are not conventional -filter_unconventional = true +filter_unconventional = false # process each line of a commit as an individual commit split_commits = false +commit_preprocessors = [ + # Transform GitHub squash PR titles: "Feat/something (#123) -> body" -> "feat: something" + { pattern = "^Feat/", replace = "feat: " }, + { pattern = "^Fix/", replace = "fix: " }, + { pattern = "^Chore/", replace = "chore: " }, + { pattern = "^Docs/", replace = "docs: " }, + { pattern = "^Refactor/", replace = "refactor: " }, + { pattern = "^Style/", replace = "style: " }, + { pattern = "^Test/", replace = "test: " }, + { pattern = "^Perf/", replace = "perf: " }, + { pattern = "^Build/", replace = "build: " }, + { pattern = "^Ci/", replace = "ci: " }, + # Strip PR number and body from squash commits + { pattern = " \\(#\\d+\\).*", replace = "" }, +] # regex for parsing and grouping commits commit_parsers = [ { message = "^feat", group = "Added" }, @@ -62,6 +77,14 @@ commit_parsers = [ { message = "^release", skip = true }, { message = "^style", group = "Styling" }, { message = "^test", group = "Testing" }, + { message = "^chore", group = "Chore" }, + { message = "^[Ff]eat/", group = "Added" }, + { message = "^[Ff]ix/", group = "Fixed" }, + { message = "^[Dd]ocs/", group = "Documentation" }, + { message = "^[Bb]uild/", group = "Build" }, + { message = "^[Rr]efactor/", group = "Refactor" }, + { message = "^[Tt]est/", group = "Testing" }, + { message = "^[Cc]hore/", group = "Chore" }, ] # protect breaking changes from being skipped due to matching a skipping commit_parser protect_breaking_commits = false