-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (31 loc) · 972 Bytes
/
Copy pathcommitlint.yml
File metadata and controls
35 lines (31 loc) · 972 Bytes
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
name: Commitlint
# Validates that every PR title is a valid Conventional Commit. Because
# maintainers merge with a merge commit and the PR title becomes that commit's
# message, this keeps `main`/`test` history clean and release tooling happy.
on:
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
pull-requests: read
jobs:
pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install commitlint
run: |
npm install --no-save \
@commitlint/cli@^19 \
@commitlint/config-conventional@^19
- name: Lint PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "$PR_TITLE" | npx --no-install commitlint --config .commitlintrc.yaml