You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://www.npmjs.com/package/semantic-commitlint)
10
4
11
5
## Problem
12
6
13
-
*[📦🚀 semantic-release](https://github.com/semantic-release/semantic-release) depends on properly formatted commit messages
14
-
*[📓 commitlint](https://github.com/marionebl/commitlint) is awesome, but it doesn't know which commits occurred since your last release
7
+
*[📦🚀 semantic-release](https://github.com/semantic-release/semantic-release) depends on properly
8
+
formatted commit messages
9
+
*[📓 commitlint](https://github.com/marionebl/commitlint) is awesome, but it doesn't know which
10
+
commits occurred since your last release
15
11
16
12
## Solution
17
13
18
-
*[semantic-commitlint](https://github.com/adriancarriger/semantic-commitlint) fills the gap between semantic-release and commitlint by asking commitlint to lint new commit messages that have not been included in a previous release
14
+
*[semantic-commitlint](https://github.com/adriancarriger/semantic-commitlint) fills the gap by
15
+
providing a hook for `semantic-release` that asks `commitlint` to lint new commit messages that
16
+
have not been included in a previous release
19
17
20
18
## Features
21
19
22
20
* Run in CI on all branches to ensure that only builds with valid commit messages pass
23
-
* Wraps [semantic-release](https://github.com/semantic-release/semantic-release) and [commitlint](https://github.com/marionebl/commitlint) for an easy install
24
-
* Minimal config
21
+
* Wraps [`semantic-release`](https://github.com/semantic-release/semantic-release) and
22
+
[`commitlint`](https://github.com/marionebl/commitlint) for an easy install
Add the following to your `semantic-release` release block (e.g. in the `release` field of your
34
+
`package.json`)
35
35
36
36
```json
37
37
{
38
-
"scripts": {
39
-
"semantic-commitlint": "semantic-commitlint",
40
-
"semantic-release": "semantic-release"
41
-
},
42
-
"release": {
43
-
"verifyRelease": ["semantic-commitlint"]
44
-
}
38
+
"verifyRelease": ["semantic-commitlint"]
45
39
}
46
40
```
47
41
48
42
Setup [semantic-release authentication](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/ci-configuration.md#ci-configuration) for CI
49
43
50
-
## Usage
51
-
52
-
Add the following commands to your CI build process
53
-
54
-
```bash
55
-
npm run semantic-commitlint -- --ci
56
-
npm run semantic-release
57
-
```
58
-
59
-
## Local usage
60
-
61
-
To get early feedback on commit messages you can add the following to a commit hook or your regular set of tests.
62
-
63
-
```bash
64
-
npm run semantic-commitlint
65
-
```
66
-
67
-
This allows your project's contributors to get early feedback on their last commit message instead of waiting for CI to fail a build.
44
+
`semantic-commitlint` currently only supports `@commitlint/config-conventional` - please open a PR
45
+
if you need support for other configurations!
68
46
69
-
***Last commit only** - this will not validate all new commit messages because Github auth is required to gather commits that have been added since the last release.
47
+
## Usage
70
48
71
-
## Config
49
+
Simply run `semantic-release` as normal as part of your CI build process
72
50
73
-
###Skip commits
51
+
## Skip commits
74
52
75
-
If there are unreleased commits that shouldn't fail a build, then add them to your `package.json` inside the `semanticCommitlint` config.
53
+
If there are unreleased commits that shouldn't fail a build, then add them to the
54
+
`SEMANTIC_COMMITLINT_SKIP` environment variable as comma-separated GIT SHAs. This should be
55
+
uncommon, provided your development workflow lints the commits before they get added to the release
56
+
branch.
76
57
77
58
```json
78
59
{
79
-
"semanticCommitlint": {
80
-
"skipCommits": ["a1be371"]
81
-
}
82
-
}
83
-
```
84
-
85
-
### Custom lint functions
86
-
87
-
To add a custom lint function add your function's path in `package.json`.
"prepare-commit-msg": "npm run semantic-commitlint -- -h"
140
-
}
141
-
}
142
-
}
143
-
```
144
-
145
74
## Issues
146
75
147
-
Not all features implemented in semantic-release and commitlint are currently available when using semantic-commtlint. If you have a suggestion, please [open an issue](https://github.com/adriancarriger/semantic-commitlint/issues/new). Thanks!
76
+
Not all features implemented in `semantic-release` and `commitlint` are currently available when
77
+
using `semantic-commtlint`. If you have a suggestion, please
78
+
[open an issue](https://github.com/mixmaxhq/semantic-commitlint/issues/new). Thanks!
148
79
149
80
## License
150
81
151
82
semantic-commitlint is licensed under the MIT Open Source license.
152
-
For more information, see the [LICENSE](LICENSE) file in this repository.
83
+
For more information, see the [LICENSE] file in this repository.
0 commit comments