Skip to content

Commit 0df1bf2

Browse files
author
Leleat
committed
ci: lint commit messages
Use `@commitlint/config-conventional` to lint commit messages to conform to the angluar commit message format. This will allow us to generate the changelog automatically in the future.
1 parent a022ad6 commit 0df1bf2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/run-ci.yml

+19
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@ name: CI
22
run-name: Check ${{ github.ref_name }} by @${{ github.actor }}
33
on: pull_request
44
jobs:
5+
commit-message:
6+
name: Check commit message format
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: '20.x'
17+
- name: Install commitlint
18+
run: |
19+
npm install @commitlint/config-conventional @commitlint/cli
20+
echo "export default {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
21+
- name: Lint commit messages
22+
run: npx commitlint --from=$(git rev-parse origin/${{ github.base_ref}}) --to=HEAD
23+
524
linters:
625
name: Run linters
726
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)