-
Notifications
You must be signed in to change notification settings - Fork 394
31 lines (30 loc) · 998 Bytes
/
commitlint.yaml
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
31
# Run commitlint on Pull Requests and commits
name: commitlint
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
push:
branches:
- master
- dev
jobs:
lint-pull-request-name:
# Only on pull requests
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn add @commitlint/config-conventional
- uses: JulienKode/pull-request-name-linter-action@v0.1.2
lint-commits:
# Only if we are pushing or merging PR to the master
if: (github.event_name == 'pull_request' && github.base_ref == 'refs/heads/master') || github.event_name == 'push'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 30 # Its fine to lint last 30 commits only
- run: yarn add @commitlint/config-conventional
- uses: wagoid/commitlint-github-action@v1