-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (28 loc) · 938 Bytes
/
lint.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: Linting
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
commitlint:
if: ${{ github.event.pull_request.merged != true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Install dependencies
run: npm i -g @commitlint/cli @commitlint/config-conventional
- name: Validate all commits from PR
if: github.event_name == 'pull_request'
run: commitlint --config ./.commitlintrc.json --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Validate all commits on pushed commits
if: github.event_name == 'push'
run: commitlint --config ./.commitlintrc.json --from=${{ github.event.before }} --verbose