Skip to content

Commit 9a514df

Browse files
committed
test: ensure commitlint preset compatibility
1 parent e089cd2 commit 9a514df

File tree

4 files changed

+462
-1
lines changed

4 files changed

+462
-1
lines changed

.commitlintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"extends": ["@insurgentlab/commitlint-config"]}

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout project
1818
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
19+
with:
20+
fetch-depth: 0
1921
- name: Use Node.js
2022
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
2123
with:
@@ -26,6 +28,15 @@ jobs:
2628
run: npm run lint
2729
- name: Run tests
2830
run: npm run test
31+
32+
# Ensure commitlint is working with HEAD version of our preset
33+
- name: Validate current commit (last commit) with commitlint
34+
if: github.event_name == 'push'
35+
run: npx commitlint --from HEAD~1 --to HEAD --verbose
36+
- name: Validate PR commits with commitlint
37+
if: github.event_name == 'pull_request'
38+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
39+
2940
- name: Upload coverage reports to Codecov
3041
if: ${{ matrix.os == 'ubuntu-latest' }}
3142
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3

0 commit comments

Comments
 (0)