File tree Expand file tree Collapse file tree 5 files changed +857
-1
lines changed
Expand file tree Collapse file tree 5 files changed +857
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Run commitlint on git commit messages
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ commitlint :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - name : Checkout the repository
10+ uses : actions/checkout@v4
11+ with :
12+ fetch-depth : 0
13+
14+ - name : Set up Node.js
15+ uses : actions/setup-node@v4
16+ with :
17+ node-version : 20
18+
19+ - name : Print versions
20+ run : |
21+ git --version
22+ node --version
23+ npm --version
24+ npx commitlint --version
25+
26+ - name : Install commitlint
27+ run : |
28+ npm install conventional-changelog-conventionalcommits
29+ npm install commitlint@latest
30+
31+ - name : Validate current commit (last commit) with commitlint
32+ if : github.event_name == 'push'
33+ run : npx commitlint --last --verbose
34+
35+ - name : Validate PR commits with commitlint
36+ if : github.event_name == 'pull_request'
37+ run : npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Original file line number Diff line number Diff line change 1+ npx --no -- commitlint --edit $1
Original file line number Diff line number Diff line change 1+ module . exports = { extends : [ '@commitlint/config-conventional' ] } ;
You can’t perform that action at this time.
0 commit comments