-
Notifications
You must be signed in to change notification settings - Fork 107
42 lines (38 loc) · 1.19 KB
/
pr-title.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
32
33
34
35
36
37
38
39
40
41
42
name: Check PR title
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
pull-requests: read
issues: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout
uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Check if PR title follows conventional commit guidelines
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
npm i -g @commitlint/cli@17.0.2 @commitlint/config-conventional@17.0.2
echo "$PR_TITLE" | commitlint