From 0df1bf27a58c97c060183b77fca6497d8ec4be19 Mon Sep 17 00:00:00 2001 From: Leleat Date: Thu, 5 Dec 2024 17:25:14 +0100 Subject: [PATCH] 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. --- .github/workflows/run-ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/run-ci.yml b/.github/workflows/run-ci.yml index 617d674..1c050e8 100644 --- a/.github/workflows/run-ci.yml +++ b/.github/workflows/run-ci.yml @@ -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