-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.12 KB
/
commitlint.yml
File metadata and controls
45 lines (36 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Commit Message Lint
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
jobs:
commitlint:
name: Commit Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: "lts/*"
# cache: "npm"
- name: Install dependencies
run: npm install -D @commitlint/cli @commitlint/config-conventional
- name: Print version information
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Check current commit message (Push event)
if: github.event_name == 'push'
run: npx commitlint --last --verbose
- name: Check PR commit messages (Pull Request event)
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose