-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (28 loc) · 894 Bytes
/
commit-lint.yml
File metadata and controls
33 lines (28 loc) · 894 Bytes
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
name: Commit Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# fetch all history for all branches and tags.
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24.x
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Install dependencies 📦
run: npm install @commitlint/cli @commitlint/config-conventional
- name: Run PR title check 💬
if: ${{ github.event_name == 'pull_request' }}
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
- name: Run commit message check 💬
if: ${{ github.event_name != 'pull_request' }}
run: npx commitlint --from HEAD~1 --to HEAD