File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on : [push, pull_request]
4+
5+ permissions :
6+ contents : read
7+
8+ jobs :
9+ commitlint :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
15+
16+ - name : Setup node
17+ uses : actions/setup-node@v4
18+ with :
19+ node-version : lts/*
20+
21+ - name : Install commitlint
22+ run : npm install -D @commitlint/cli @commitlint/config-conventional
23+
24+ - name : Setup commitlint
25+ run : |
26+ echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
27+
28+ - name : Print versions
29+ run : |
30+ git --version
31+ node --version
32+ npm --version
33+ npx commitlint --version
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.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
You can’t perform that action at this time.
0 commit comments