Skip to content

Commit

Permalink
ci: lint commit messages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Leleat committed Dec 5, 2024
1 parent a022ad6 commit 0df1bf2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/run-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ name: CI
run-name: Check ${{ github.ref_name }} by @${{ github.actor }}
on: pull_request
jobs:
commit-message:
name: Check commit message format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install commitlint
run: |
npm install @commitlint/config-conventional @commitlint/cli
echo "export default {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
- name: Lint commit messages
run: npx commitlint --from=$(git rev-parse origin/${{ github.base_ref}}) --to=HEAD

linters:
name: Run linters
runs-on: ubuntu-latest
Expand Down

0 comments on commit 0df1bf2

Please sign in to comment.