Skip to content

Commit 6fb2151

Browse files
committed
build(*): enforce conventional commits
1 parent 78a0a17 commit 6fb2151

File tree

5 files changed

+1073
-8
lines changed

5 files changed

+1073
-8
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,41 @@ on:
1414
- '.github/workflows/**'
1515
workflow_dispatch:
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
1720

1821
env:
1922
NODE_VERSION: 20
2023
JAVA_VERSION: 21
2124

2225
jobs:
26+
commitlint:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Set up Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: ${{ env.NODE_VERSION }}
37+
cache: 'npm'
38+
39+
- name: Install commitlint
40+
run: |
41+
npm install conventional-changelog-conventionalcommits
42+
npm install commitlint@latest
43+
44+
- name: Validate current commit (last commit) with commitlint
45+
if: github.event_name == 'push'
46+
run: npx commitlint --last --verbose
47+
48+
- name: Validate PR commits with commitlint
49+
if: github.event_name == 'pull_request'
50+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
51+
2352
lint:
2453
name: Lint
2554
runs-on: ubuntu-latest
@@ -37,9 +66,15 @@ jobs:
3766
- name: Install dependencies
3867
run: npm ci
3968

40-
- name: Run Lint
69+
- name: Run Lint for web plfatform
4170
run: npm run lint
4271

72+
- name: Run Lint for iOS platform
73+
run: npm run lint:ios
74+
75+
- name: Run Prettier
76+
run: npm run prettier:check
77+
4378
verify-ios:
4479
name: Verify iOS
4580
runs-on: macos-latest

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

commitlint.config.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
};

0 commit comments

Comments
 (0)