Skip to content

Commit 60b2790

Browse files
committed
feat(common): simplify commit msg check
1 parent 3fa5f63 commit 60b2790

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://github.com/marketplace/actions/conventional-commit-lint
2+
3+
name: Conventional Commit Lint
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
commit-lint:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
# conventional style
12+
- uses: ahmadnassri/action-commit-lint@v2.0.4

.husky/init.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
cd ..
4+
# 安装 husky
5+
npm install -g husky
6+
7+
# 安装 husky git hooks
8+
npx husky install
9+
10+
# commitlint 安装配置
11+
npm install -g @commitlint/cli @commitlint/config-conventional
12+
13+
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > ../commitlint.config.js
14+
15+
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'

0 commit comments

Comments
 (0)