Skip to content

Commit 71522d6

Browse files
author
Blake Holifield
committed
style(commit): add commitlint to hook and ci
1 parent 044b80e commit 71522d6

File tree

5 files changed

+582
-343
lines changed

5 files changed

+582
-343
lines changed

.github/workflows/ci.yml

+19
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@ jobs:
2020
- uses: './.github/actions/cypress-cache'
2121
- name: Install deps
2222
run: npm ci
23+
commitlint:
24+
needs: [install]
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
- name: Install commitlint
31+
run: |
32+
npm install conventional-changelog-conventionalcommits
33+
npm install commitlint@latest
34+
35+
- name: Validate current commit (last commit) with commitlint
36+
if: github.event_name == 'push'
37+
run: npx commitlint --last --verbose
38+
39+
- name: Validate PR commits with commitlint
40+
if: github.event_name == 'pull_request'
41+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
2342
lint:
2443
needs: [install]
2544
runs-on: ubuntu-latest

.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {extends: ['@commitlint/config-conventional']};

0 commit comments

Comments
 (0)