File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1717 node --version
1818 npm --version
1919 npx commitlint --version
20+ - name : Get commit count
21+ id : commit_count
22+ run : echo "commit_count=$(git rev-list HEAD --count)" >>$GITHUB_OUTPUT
2023 - name : Validate current commit (last commit) with commitlint
21- if : github.event_name == 'push'
24+ if : github.event_name == 'push' && steps.commit_count.outputs.commit_count > 1
2225 run : npx commitlint --from HEAD~1 --to HEAD --verbose
2326 - name : Validate PR commits with commitlint
2427 if : github.event_name == 'pull_request'
25- run : npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
28+ run : npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
You can’t perform that action at this time.
0 commit comments