File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 - uses : actions/checkout@v4
1111 with :
1212 fetch-depth : 0
13- - uses : actions/setup-node@v4
14- with :
15- node-version : 20
16- - run : npm ci
17- - run : npx commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.sha }}
13+ - name : Validate Conventional Commits
14+ run : |
15+ set -euo pipefail
16+ RANGE="${{ github.event.pull_request.base.sha }}..${{ github.sha }}"
17+
18+ invalid=0
19+ while IFS= read -r message; do
20+ [[ -z "$message" ]] && continue
21+
22+ if [[ "$message" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9._/-]+\))?!?:\ .+ ]]; then
23+ continue
24+ fi
25+
26+ echo "Invalid conventional commit message: $message"
27+ invalid=1
28+ done < <(git log --format=%s "$RANGE")
29+
30+ if [[ $invalid -ne 0 ]]; then
31+ exit 1
32+ fi
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments