Repository navigation
Expand file tree
/
Copy pathcliff.toml
More file actions
160 lines (151 loc) · 7.68 KB
/
Copy pathcliff.toml
File metadata and controls
160 lines (151 loc) · 7.68 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
# DO NOT EDIT. Generated with:
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/ca98afc7bd0a436e9847fb799aacc102a523b453/pkg/gen/input/workflows/internal/file/cliff.toml.template
#
# git-cliff config for the push-based auto-release flow.
#
# A single git-cliff invocation in .github/workflows/auto-release.yaml runs
# `--unreleased --bump --context` to compute the next semver from conventional
# commits AND emit the JSON context that the same workflow then re-renders
# with `--from-context --strip all` for the release-notes body posted on the
# GitHub Release. One commit walk, one set of GitHub API PR lookups, two
# cheap outputs.
[bump]
# `feat:` always bumps minor (not patch). Matches conventional-commits spec.
features_always_bump_minor = true
# `feat!:`/`BREAKING CHANGE` always bumps major.
breaking_always_bump_major = true
# First release in a repo with no tags yet. git-cliff defaults this to
# "0.1.0" (no prefix); we pin it to "v0.1.0" because the whole giantswarm
# stack (architect's /^v.*/ tag filter, the auto-release workflow's
# `--match='v*.*.*'` describe, gitsemver) expects the leading `v`. Once any
# v*.*.* tag exists, git-cliff carries that prefix forward on every bump, so
# this only governs the inception release.
initial_tag = "v0.1.0"
[git]
conventional_commits = true
# Drop non-conventional commits silently rather than counting them as
# unclassified work -- the bump-decider should only act on intent-bearing
# commits.
filter_unconventional = true
# Changelog presentation order. `topo_order = false` orders releases
# chronologically (by tag date); `sort_commits = "oldest"` lists the commits
# within each release oldest-first.
topo_order = false
sort_commits = "oldest"
# Scope `--bump`'s baseline to the current branch. This is load-bearing for
# two reasons:
#
# 1. Backports. The auto-release workflow also fires on `release-*`
# maintenance branches. Without this, git-cliff's `--bump` picks the
# GLOBALLY highest-semver tag in the repo regardless of reachability --
# so a fix on `release-2.x` would bump from v3.1.0 (latest on main) and
# tag v3.1.1 ON the 2.x line instead of the intended v2.8.1. With
# `use_branch_tags`, git-cliff only considers tags reachable from the
# checked-out branch, so the 2.x line correctly bumps from v2.8.0.
#
# 2. Stray tags on side branches. A tag created on an unmerged branch
# (e.g. someone tags v9.0.0 while testing a release on a `bump/*`
# branch) is the global semver max but is NOT reachable from main.
# Without this it silently becomes the baseline for every subsequent
# main release, and a `feat:` on a v1.2.8 line produces v9.1.0.
# Branch-scoped tags exclude it.
use_branch_tags = true
# Only vX.Y.Z is a release. git-cliff applies this before everything else, so
# a tag that does not match is not a boundary for `--unreleased`, not a
# baseline for `--bump` and not a release in the changelog. That is what keeps
# a candidate cycle one range: the auto-release flow cuts vX.Y.Z-rc.N tags on
# the branch head, and counting those as releases would cut every later
# candidate, and the stable release promoted from the cycle, from a partial
# delta -- a cycle a `feat` put on a minor falls back to a patch. The price is
# that candidate notes are cumulative: rc.2 lists what rc.1 listed, plus what
# is new.
#
# It also keeps a pre-release or preview tag off the version line wherever it
# lives, which `use_branch_tags` alone only does on a SIDE branch: such a name
# always carries a suffix, so it can never match. The workflow's
# `git describe --match='v*.*.*' --exclude='*-*' --exclude='*+*'` baseline
# selects the same tags, and the two have to stay in step.
tag_pattern = '^v[0-9]+\.[0-9]+\.[0-9]+$'
# Strip the trailing " (#N)" that GitHub appends to squash-merge commit
# messages. Our template renders the PR link explicitly via cliff's GitHub
# integration (commit.remote.pr_number -- see [changelog].body), so the
# auto-appended reference would duplicate it.
#
# `(?m)` enables multi-line mode so `$` matches end-of-line (the squash
# `(#N)` lives at the end of the subject line, not the end of the full
# commit text -- git-cliff's default regex mode is single-line). This
# anchoring keeps `(#N)` references that appear inside commit bodies
# untouched.
commit_preprocessors = [
{ pattern = '(?m) \(#\d+\)$', replace = "" },
]
# Map commit types to changelog groups (Keep-a-Changelog convention):
# feat -> Added, fix -> Fixed, all "internal change" types -> Changed,
# security -> Security.
#
# `ci`, `chore`, `docs`, `style` and `test` are marked skip: none of them changes what
# ships. git-cliff decides the bump from the commits that are NOT skipped: a
# breaking change bumps the major, `feat` the minor, every other type at least
# the patch. A skipped commit is left out of the release notes and of the
# bump, so a push containing only skipped types outside a candidate cycle
# computes the current version and the workflow tags nothing; the changes ship
# with the next releasable commit. During a cycle the workflow lets a new test
# commit advance an existing candidate without changing its version or notes.
# Use `fix` or `feat` when a dependency or build change needs a release of its
# own.
commit_parsers = [
{ message = "^feat", group = "Added" },
{ message = "^fix", group = "Fixed" },
{ message = "^refactor", group = "Changed" },
{ message = "^perf", group = "Changed" },
{ message = "^docs", skip = true },
{ message = "^chore", skip = true },
{ message = "^test", skip = true },
{ message = "^build", group = "Changed" },
{ message = "^ci", skip = true },
{ message = "^security", group = "Security" },
{ message = "^style", skip = true },
]
# GitHub repo coordinates -- required for the API lookups that populate
# `commit.remote.pr_number` and `commit.remote.username` in the template
# below. The token is passed automatically via the workflow's GITHUB_TOKEN.
[remote.github]
owner = "giantswarm"
repo = "agentlab"
# Template for the rendered release notes. Body is what gets posted to the
# GitHub Release; header and footer are empty so the release page shows only
# the section list.
#
# Each bullet ends with " in [#N](pr-url) by [@user](user-url)" when
# git-cliff successfully resolves the PR for the commit via the GitHub API.
# `commit.remote` is the post-2.x replacement for the per-platform fields
# (commit.github / commit.gitlab / etc.) -- using it future-proofs the
# template against git-cliff dropping the old names.
# Backslashes at line ends escape the newline so the bullet stays on one
# line in the rendered Markdown.
[changelog]
header = ""
# `{%-` / `-%}` strip the surrounding newline so the rendered Markdown is
# tight: one blank line before each "### " header, no leading blank, no
# double-blank between header and bullets. Without the whitespace control
# the output picks up two extra blank lines per loop iteration.
body = """
{% for group, commits in commits | group_by(attribute="group") -%}
### {{ group }}
{% for commit in commits -%}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | split(pat="\n") | first | upper_first }}\
{% if commit.remote.pr_number %} in [#{{ commit.remote.pr_number }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.remote.pr_number }}){% endif %}\
{% if commit.remote.username %} by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}){% endif %}
{% endfor %}
{% endfor -%}
{% if previous.version %}
**Full Changelog**: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/compare/{{ previous.version }}...{{ version }}
{% endif -%}
"""
trim = true
footer = ""