Skip to content

Commit 8749a95

Browse files
committed
chore: add commitlint workflow
1 parent 08ab8db commit 8749a95

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Commit Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
commitlint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v3
16+
- name: Lint Commit Messages
17+
uses: wagoid/commitlint-github-action@v6
18+
permissions:
19+
contents: read
20+
pull-requests: read

commitlint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'header-max-length': [2, 'always', 64],
5+
'body-max-line-length': [2, 'always', 72],
6+
'type-enum': [
7+
2,
8+
'always',
9+
[
10+
'build',
11+
'chore',
12+
'ci',
13+
'docs',
14+
'feat',
15+
'fix',
16+
'impr',
17+
'perf',
18+
'refactor',
19+
'revert',
20+
'style',
21+
'test',
22+
],
23+
],
24+
},
25+
};

0 commit comments

Comments
 (0)