Skip to content

Commit 58c625f

Browse files
Очеретович ОксанаОчеретович Оксана
authored andcommitted
chore(repo): enforce conventional commit messages
1 parent c51d56a commit 58c625f

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

.github/workflows/commitlint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: commitlint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
lint-commits:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 18
17+
18+
- run: npm install --no-save @commitlint/cli @commitlint/config-conventional
19+
- run: npx commitlint --from origin/next --to HEAD
20+
;

commitlint.config.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
['feat', 'fix', 'chore', 'refactor', 'docs', 'test', 'perf', 'ci'],
8+
],
9+
'scope-case': [2, 'always', 'kebab-case'],
10+
'subject-case': [2, 'always', ['lower-case']],
11+
'subject-full-stop': [2, 'never', '.'],
12+
},
13+
};

lefthook.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
commit-msg:
2+
commands:
3+
commitlint:
4+
run: npx commitlint --edit {1}

0 commit comments

Comments
 (0)