-
Notifications
You must be signed in to change notification settings - Fork 3
30 lines (28 loc) · 983 Bytes
/
commitlint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
name: Lint Commit Messages
on: [pull_request]
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v6
strict-commitlint:
name: Strict commit lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v6
with:
failOnWarnings: true
- name: Check amount of commits
# Run this check even if previous one failed
if: always()
env:
COMMITS_COUNT: ${{ github.event.pull_request.commits }}
run: |-
if [ $COMMITS_COUNT -gt 2 ]; then
echo "You have ${COMMITS_COUNT} commits in your PR. Didn't you mean to squash them?"
exit 1
fi
echo "Your PR seems correct. Good job."