Skip to content

Commit 114f14f

Browse files
committed
ci: Add commitlint
JIRA: CPOUI5FOUNDATION-1152
1 parent 31357f6 commit 114f14f

File tree

5 files changed

+908
-0
lines changed

5 files changed

+908
-0
lines changed

.github/workflows/commitlint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Commit Message Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
commitlint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint:commit -- --edit "$1" # Lint currently edited commit message

commitlint.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
export default {
2+
extends: [
3+
"@commitlint/config-conventional",
4+
],
5+
rules: {
6+
"type-enum": [
7+
2,
8+
"always",
9+
[
10+
"build",
11+
"ci",
12+
"deps",
13+
"docs",
14+
"feat",
15+
"fix",
16+
"perf",
17+
"refactor",
18+
"release",
19+
"revert",
20+
"style",
21+
"test",
22+
],
23+
],
24+
"body-max-line-length": [2, "always", 160],
25+
"footer-max-line-length": [0],
26+
"subject-case": [
27+
2, "always",
28+
["sentence-case", "start-case", "pascal-case"],
29+
],
30+
},
31+
ignores: [
32+
// Ignore release commits, as their subject doesn't start with an uppercase letter
33+
(message) => message.startsWith("release: v"),
34+
],
35+
};

0 commit comments

Comments
 (0)