File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Lint Commits
2+
3+ on :
4+ pull_request :
5+
6+ permissions :
7+ contents : read # to fetch code (actions/checkout)
8+
9+ jobs :
10+ lint-pr-first-commit :
11+ name : Commit Lint
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v6
15+ with :
16+ fetch-depth : 0
17+ - uses : actions/setup-node@v6
18+ with :
19+ node-version : 22.x
20+ - run : npm install
21+ - name : Lint first PR commit message
22+ run : |
23+ FIRST=$(git rev-list --reverse ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | head -1)
24+ echo "Base: ${{ github.event.pull_request.base.sha }}"
25+ echo "Head: ${{ github.event.pull_request.head.sha }}"
26+ echo "First PR commit: $FIRST"
27+ git log -1 --format=%B "$FIRST" | npx commitlint --verbose
Original file line number Diff line number Diff line change 1+ export default {
2+ extends : [ '@commitlint/config-conventional' ]
3+ } ;
Original file line number Diff line number Diff line change 3737 "node" : " ^22.22.2 || ^24.15.0 || >=26.0.0"
3838 },
3939 "devDependencies" : {
40+ "@commitlint/cli" : " ^21.0.2" ,
41+ "@commitlint/config-conventional" : " ^21.0.2" ,
4042 "bindings" : " ^1.5.0" ,
4143 "cross-env" : " ^10.1.0" ,
4244 "eslint" : " ^9.39.1" ,
You can’t perform that action at this time.
0 commit comments