File tree 3 files changed +71
-0
lines changed
3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ message conventions. Plugins are available for:
181
181
- auto-changelog
182
182
- Conventional Changelog
183
183
- Keep A Changelog
184
+ - git-cliff
184
185
185
186
To print the changelog without releasing anything, add the ` --changelog ` flag.
186
187
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ these commands output the changelog to `stdout`.
10
10
- [ auto-changelog] [ 3 ]
11
11
- [ Conventional Changelog] [ 4 ]
12
12
- [ Keep A Changelog] [ 5 ]
13
+ - [ git-cliff] [ 14 ]
13
14
14
15
Some projects keep their changelog in e.g. ` CHANGELOG.md ` or ` history.md ` . To auto-update this file and include this in
15
16
the release commit, the recommended configuration is to do this in the ` after:bump ` hook (see example below).
@@ -92,6 +93,14 @@ This plugin updates `CHANGELOG.md` file according to
92
93
}
93
94
```
94
95
96
+ ## Git-cliff
97
+
98
+ Git-cliff is a customizable changelog generator that follows
99
+ Conventional Commit specifications. Similar to auto-changelog, it can be used
100
+ as a companion to release-it.
101
+
102
+ See the [ git-cliff recipe] [ 15 ] for an example setup.
103
+
95
104
[ 1 ] : ../config/release-it.json
96
105
[ 2 ] : #github-and-gitlab-releases
97
106
[ 3 ] : #auto-changelog
@@ -105,3 +114,5 @@ This plugin updates `CHANGELOG.md` file according to
105
114
[ 11 ] : https://github.com/release-it/conventional-changelog
106
115
[ 12 ] : https://keepachangelog.com
107
116
[ 13 ] : https://github.com/release-it/keep-a-changelog
117
+ [ 14 ] : https://github.com/orhun/git-cliff
118
+ [ 15 ] : ./recipes/git-cliff.md
Original file line number Diff line number Diff line change
1
+ # Git-cliff
2
+
3
+ Please refer to [ git-cliff documentation] [ 1 ] for more details and usage.
4
+
5
+ ## Config
6
+
7
+ Add git-cliff to the project:
8
+
9
+ ``` bash
10
+ npm install --save-dev git-cliff
11
+ ```
12
+
13
+ Git-cliff has the ability to use the Conventional Commits convention
14
+ to automatically set the package version.
15
+ Release-it allows the user to select the version that should be released.
16
+ Therefore, it may be helpful to generate the changelog from the version in the
17
+ ` package.json ` that was bumped by release-it.
18
+
19
+ ``` sh
20
+ #! /usr/bin/env bash
21
+
22
+ NODE_VERSION=$( node -p -e " require('./package.json').version" )
23
+
24
+ if [ " $1 " = " stdout" ]; then
25
+ npm exec git-cliff -o - --unreleased --tag $NODE_VERSION
26
+ else
27
+ npm exec git-cliff -o ' ./CHANGELOG.md' --tag $NODE_VERSION
28
+ fi
29
+ ```
30
+
31
+ Example configuration in the release-it config:
32
+
33
+ ``` json
34
+ {
35
+ "hooks" : {
36
+ "after:bump" : " ./changelog.sh"
37
+ },
38
+ "github" : {
39
+ "releaseNotes" : " ./changelog.sh stdout"
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## Template
45
+
46
+ Git-cliff uses Tera as a templating language, which is inspired by Jinja2 and
47
+ Django templates.
48
+
49
+ See [ git-cliff syntax docs] [ 2 ] for more information.
50
+
51
+ ## Monorepos
52
+
53
+ Git-cliff has a ` --include-path ` flag to scope changes to a specific directory path.
54
+
55
+ See [ git-cliff monorepo docs] [ 3 ] for more information.
56
+
57
+ [ 1 ] : https://github.com/orhun/git-cliff
58
+ [ 2 ] : https://git-cliff.org/docs/templating/examples
59
+ [ 3 ] : https://git-cliff.org/docs/usage/monorepos
You can’t perform that action at this time.
0 commit comments