Skip to content

Commit cde1af8

Browse files
committed
feat: add push check
1 parent 74cf2ae commit cde1af8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/commitlint.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Organization Commit Message Lint
22

33
on:
4+
push:
5+
branches: [main, develop]
46
pull_request:
57
types: [opened, synchronize, edited, reopened]
68

@@ -24,4 +26,8 @@ jobs:
2426
2527
- name: Run commitlint
2628
run: |
27-
npx commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.sha }}
29+
if [ "${{ github.event_name }}" = "pull_request" ]; then
30+
npx commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.sha }}
31+
else
32+
npx commitlint --from=HEAD~1 --to=HEAD
33+
fi

0 commit comments

Comments
 (0)