-
Notifications
You must be signed in to change notification settings - Fork 62
48 lines (43 loc) · 1.52 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Check PR title
on:
pull_request:
branches: [ master ]
types: [opened, edited, synchronize, reopened]
jobs:
commitlint:
name: Check PR title
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: |
package-lock.json
- name: Install deps
run: npm ci --ignore-scripts
- name: Verify PR title is in the correct format
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
echo $TITLE | npx commitlint -V
needs-migration-docs-check:
runs-on: ubuntu-latest
steps:
- name: Echo event name
env:
TITLE: ${{ github.event.pull_request.title }}
EVENT: ${{ github.event_name }}
run: echo "$EVENT:$TITLE"
- name: Check PR name for breaking changes
if: github.event_name == 'pull_request' && ( contains(github.event.pull_request.title, '!') || contains(github.event.pull_request.title, 'BREAKING CHANGE') )
uses: mshick/add-pr-comment@v2
with:
message-id: upgrade-guide
message: |
:warning: Breaking change detected. This PR will cause a major version upgrade. Please make sure to:
- [ ] Create an upgrade guide in the documentation project.
If you believe an upgrade guide is unnecessary, go ahead and check this box anyway.