Skip to content

Commit a243f2e

Browse files
dougchboquan-fang
andauthored
ci: Add a conv. commit lint action+config (#2881)
Co-authored-by: Boquan Fang <[email protected]>
1 parent 3d1bf03 commit a243f2e

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
// refer to https://commitlint.js.org/reference/rules-configuration.html#rules-configuration for rule configurations
4+
rules: {
5+
'subject-case': [0],
6+
'body-max-line-length': [0],
7+
'footer-max-line-length': [0],
8+
'type-enum': [2, 'always', [
9+
'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test',
10+
'opt', 'internal', 'tests'
11+
]]
12+
},
13+
parserPreset: {
14+
parserOpts: {
15+
issuePrefixes: ['#']
16+
}
17+
},
18+
ignores: [
19+
(message) => message.includes('Co-authored-by:')
20+
]
21+
};

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,15 @@ jobs:
835835
cat /tmp/typos.json
836836
! grep -q '[^[:space:]]' /tmp/typos.json
837837
838+
commit-lint:
839+
runs-on: ubuntu-latest
840+
steps:
841+
- uses: actions/checkout@v5
842+
with:
843+
submodules: true
844+
- uses: ahmadnassri/action-commit-lint@v2
845+
with:
846+
config: ./.github/config/commitlint.config.js
838847
kani:
839848
runs-on: ubuntu-latest
840849
strategy:

0 commit comments

Comments
 (0)