-
Notifications
You must be signed in to change notification settings - Fork 2
32 lines (29 loc) · 1003 Bytes
/
Copy pathcommitlint.yml
File metadata and controls
32 lines (29 loc) · 1003 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
name: Commit messages
# Pull requests only: the PR title and the PR's commits follow Conventional Commits. Commits pushed to main directly
# are not checked.
on:
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-node@v7
with:
node-version: 24
- name: Install commitlint
run: npm install --no-save --no-package-lock @commitlint/cli@19 @commitlint/config-conventional@19
- name: Pull request title
env:
TITLE: ${{ github.event.pull_request.title }}
run: printf '%s\n' "$TITLE" | npx --no-install commitlint --verbose
- name: Pull request commits
run: >-
npx --no-install commitlint --verbose
--from ${{ github.event.pull_request.base.sha }}
--to ${{ github.event.pull_request.head.sha }}