-
Notifications
You must be signed in to change notification settings - Fork 0
/
commit-lint.yml
51 lines (43 loc) · 1.44 KB
/
commit-lint.yml
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
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- run: npm ci
- name: Install commitlint
run: |
npm install -g @commitlint/cli@^18
- name: Validate all commits from PR
run: npx commitlint --config .github/config/commitlint.config.js --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
-----------------------
commitlint.config.js:
-----------------------
const RuleConfigSeverity = require("@commitlint/types").RuleConfigSeverity;
const Configuration = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ["@commitlint/config-conventional"],
/*
* Resolve and load conventional-changelog-atom from node_modules.
* Referenced packages must be installed
*/
parserPreset: "conventional-changelog-conventionalcommits",
/*
* Resolve and load @commitlint/format from node_modules.
* Referenced package must be installed
*/
formatter: "@commitlint/format",
/*
* Any rules defined here will override rules from @commitlint/config-conventional
*/
rules: {
"type-empty": [RuleConfigSeverity.Error, "never"],
},
};
module.exports = Configuration;