From fa75e9a935e105d34eb82009379cb727419bde11 Mon Sep 17 00:00:00 2001 From: MilesCranmerBot Date: Sat, 28 Mar 2026 14:28:18 +0000 Subject: [PATCH] ci: add commitlint workflow Co-authored-by: Miles Cranmer --- .github/workflows/commitlint.yml | 39 ++++++++++++++++++++++++++++++++ commitlint.config.mjs | 3 +++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/commitlint.yml create mode 100644 commitlint.config.mjs diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 00000000..28a52bd0 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,39 @@ +name: commitlint + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +permissions: + contents: read + pull-requests: read + +jobs: + pr-title: + name: PR title + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: '22' + - name: Lint PR title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + echo "$PR_TITLE" | npx --yes -p @commitlint/cli -p @commitlint/config-conventional commitlint --config commitlint.config.mjs + + commits: + name: commits + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v6 + with: + configFile: commitlint.config.mjs diff --git a/commitlint.config.mjs b/commitlint.config.mjs new file mode 100644 index 00000000..0616fb93 --- /dev/null +++ b/commitlint.config.mjs @@ -0,0 +1,3 @@ +export default { + extends: ['@commitlint/config-conventional'], +};