Skip to content

Commit ca086de

Browse files
committed
feat: add commitlint action (#22)
1 parent 802df93 commit ca086de

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/commitlint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
commitlint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
with:
9+
fetch-depth: 0
10+
- name: Print versions
11+
run: |
12+
git --version
13+
node --version
14+
npm --version
15+
npx commitlint --version
16+
- name: Install commitlint
17+
run: |
18+
npm install conventional-changelog-conventionalcommits
19+
npm install commitlint@latest
20+
- name: Validate current commit (last commit) with commitlint
21+
if: github.event_name == 'push'
22+
run: npx commitlint --from HEAD~1 --to HEAD --verbose
23+
- name: Validate PR commits with commitlint
24+
if: github.event_name == 'pull_request'
25+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 commit comments

Comments
 (0)