-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcliff.toml
More file actions
172 lines (152 loc) · 7.62 KB
/
cliff.toml
File metadata and controls
172 lines (152 loc) · 7.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# git-cliff Configuration for OpenNext.js CLI
# Generates CHANGELOG.md entries matching Keep a Changelog format
# Documentation: https://git-cliff.org/docs/configuration
[changelog]
header = """
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
"""
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% for group, commits in commits | group_by(attribute="group") %}\
### {{ group | upper_first }}
{% for commit in commits %}\
{% if commit.remote.pr_labels is containing("skip-release-notes") %}\
{% else %}\
- {{ commit.message | split(pat="\n") | first | trim }}\
{% if commit.id %}([{{ commit.id | truncate(length=7, end="") }}](https://github.com/JSONbored/opennextjs-cli/commit/{{ commit.id }})){%- endif %}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif %}\
{% if commit.remote.pr_number %} in [#{{ commit.remote.pr_number }}](https://github.com/JSONbored/opennextjs-cli/pull/{{ commit.remote.pr_number }}){%- endif %}
{% endif %}\
{% endfor %}
{% endfor %}\
{% if github.contributors | filter(attribute="is_first_time", value=true) | length > 0 %}
### New Contributors
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
- @{{ contributor.username }} made their first contribution in [#{{ contributor.pr_number }}](https://github.com/JSONbored/opennextjs-cli/pull/{{ contributor.pr_number }})
{% endfor %}
{% endif %}\
{% if statistics %}
### Statistics
- {{ statistics.commit_count }} commit{% if statistics.commit_count != 1 %}s{% endif %} in this release
- {{ statistics.conventional_commit_count }} conventional commit{% if statistics.conventional_commit_count != 1 %}s{% endif %}
{% if statistics.links | length > 0 %}
- {{ statistics.links | length }} linked issue{% if statistics.links | length != 1 %}s{% endif %}/PR{% if statistics.links | length != 1 %}s{% endif %}
{% endif %}
{% if statistics.days_passed_since_last_release %}
- {{ statistics.days_passed_since_last_release }} day{% if statistics.days_passed_since_last_release != 1 %}s{% endif %} since last release
{% endif %}
{% endif %}\
{% else %}\
## [Unreleased]
{% for group, commits in commits | group_by(attribute="group") %}\
### {{ group | upper_first }}
{% for commit in commits %}\
{% if commit.remote.pr_labels is containing("skip-release-notes") %}\
{% else %}\
- {{ commit.message | split(pat="\n") | first | trim }}\
{% if commit.id %}([{{ commit.id | truncate(length=7, end="") }}](https://github.com/JSONbored/opennextjs-cli/commit/{{ commit.id }})){%- endif %}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif %}\
{% if commit.remote.pr_number %} in [#{{ commit.remote.pr_number }}](https://github.com/JSONbored/opennextjs-cli/pull/{{ commit.remote.pr_number }}){%- endif %}
{% endif %}\
{% endfor %}
{% endfor %}\
{% endif %}\
"""
footer = """
{% for release in releases %}
{% if release.version %}
{% if release.previous and release.previous.version %}
[{{ release.version | trim_start_matches(pat="v") }}]: https://github.com/JSONbored/opennextjs-cli/compare/{{ release.previous.version }}..{{ release.version }}
{% else %}
[{{ release.version | trim_start_matches(pat="v") }}]: https://github.com/JSONbored/opennextjs-cli/releases/tag/{{ release.version }}
{% endif %}
{% else %}
{% if release.previous and release.previous.version %}
[unreleased]: https://github.com/JSONbored/opennextjs-cli/compare/{{ release.previous.version }}..HEAD
{% endif %}
{% endif %}
{% endfor %}
<!-- generated by git-cliff -->
"""
output = "CHANGELOG.md"
prepend = true
trim = true
[git]
conventional_commits = true
filter_commits = true
# Explicit tag pattern to match only version tags (v0.1.0, v1.2.3, etc.)
# Ignores other tags like alpha, beta, rc, etc.
tag_pattern = "^v[0-9]+\\.[0-9]+\\.[0-9]+$"
# Squash Merge Support:
# git-cliff automatically processes all commits in the repository, including squash merge commits.
# When a PR is squash merged, GitHub creates a single commit with:
# - Commit message: The PR title (should follow conventional commits: feat:, fix:, etc.)
# - Commit body: The PR description (optional)
# git-cliff processes this commit just like any other commit, so squash merges work seamlessly.
# The commit_preprocessors below handle PR references and merge messages automatically.
commit_parsers = [
{ message = "^feat", group = "Added" },
{ message = "^fix", group = "Fixed" },
{ message = "^perf", group = "Changed" },
{ message = "^refactor", group = "Changed" },
{ message = "^style", group = "Changed" },
{ message = "^security", group = "Security" },
{ message = "^deprecate", group = "Removed" },
{ message = "^docs", skip = true },
{ message = "^test", skip = true },
{ message = "^chore", skip = true },
{ message = "^ci", skip = true },
{ message = "^build", skip = true },
{ message = "^revert", group = "Fixed" },
]
protect_breaking_commits = true
filter_unconventional = true
sort_commits = "oldest"
link_parsers = [
{ pattern = "#(\\d+)", href = "https://github.com/JSONbored/opennextjs-cli/issues/$1" },
{ pattern = "([a-f0-9]{7})[a-f0-9]*", text = "$1", href = "https://github.com/JSONbored/opennextjs-cli/commit/$0" },
]
commit_preprocessors = [
# Handle GitHub PR merge messages (standard format)
# Note: Squash merges create a single commit with the PR title/description
# git-cliff processes all commits, including squash merge commits
# The commit message from squash merges should follow conventional commits (feat:, fix:, etc.)
{ pattern = '^Merge pull request #(\\d+)', replace = "([#${1}](https://github.com/JSONbored/opennextjs-cli/pull/${1}))" },
# Handle merge commits with PR numbers in different formats
{ pattern = '^Merge PR #(\\d+)', replace = "([#${1}](https://github.com/JSONbored/opennextjs-cli/pull/${1}))" },
# Handle Azure DevOps PR merge messages
{ pattern = '^Merged PR #\\d+: (.+)', replace = "$1" },
# Handle PR references in commit messages (e.g., "fix: issue (#123)" or "fix: issue #123")
# This works with squash merges where PR references are included in the commit message
{ pattern = '\\(#(\\d+)\\)', replace = "([#${1}](https://github.com/JSONbored/opennextjs-cli/pull/${1}))" },
# Handle standalone PR references (space before #, followed by digits, then non-digit or end)
{ pattern = ' #(\\d+)([^0-9]|$)', replace = " [#${1}](https://github.com/JSONbored/opennextjs-cli/pull/${1})${2}" },
# Handle co-authored commits (Co-authored-by: user@example.com)
# Extract co-author information for better attribution
{ pattern = 'Co-authored-by: (.+)', replace = "Co-authored-by: $1" },
# Normalize multiple spaces to single space
{ pattern = ' +', replace = " " },
# Remove trailing periods from commit messages for consistency
{ pattern = '\\.$', replace = "" },
# Clean up common merge commit prefixes
{ pattern = "^Merge branch '[^']+' into ", replace = "" },
{ pattern = '^Merge .+ into ', replace = "" },
]
[bump]
# Version bumping configuration for git-cliff
# git-cliff analyzes commits to determine version bump type:
# - feat: commits → minor bump
# - fix: commits → patch bump
# - feat!: or BREAKING CHANGE: → major bump
features_always_bump_minor = true
breaking_always_bump_major = true
initial_tag = "0.1.0"
[remote.github]
owner = "JSONbored"
repo = "opennextjs-cli"
# Token is provided via GITHUB_TOKEN environment variable in workflow
# This enables automatic PR links, better commit metadata, and enhanced changelog entries