File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Validate Commit Messages
2+
3+ on :
4+ push :
5+ branches :
6+ - omric/merge-commit-test
7+
8+ jobs :
9+ validate-commits :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0 # needed to get full commit history
16+
17+ - name : Install commitlint
18+ run : |
19+ npm install -g @commitlint/{cli,config-conventional}
20+
21+ - name : Validate commit messages
22+ run : |
23+ # Get commits in this push
24+ COMMITS=$(git log ${{ github.event.before }}..${{ github.sha }} --pretty=format:%s)
25+
26+ echo "Checking commits:"
27+ echo "$COMMITS"
28+
29+ echo "$COMMITS" | while read line; do
30+ if [ -n "$line" ]; then
31+ echo "$line" | npx commitlint
32+ fi
33+ done
Original file line number Diff line number Diff line change 1+ export default { extends : [ '@commitlint/config-conventional' ] } ;
You can’t perform that action at this time.
0 commit comments