From 9407eb958d8cf4af40dac6b535f07b59dc4067d2 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sat, 21 Mar 2026 00:41:16 +0100 Subject: [PATCH] ci: Add linter to make sure we use Conventional Commits This will make it easier for us to write Changelogs for example. See https://www.conventionalcommits.org/en/v1.0.0. Also mentioned in the CONTRIBUTING.md Signed-off-by: Michael Vetter --- .commitlintrc.json | 23 +++++++++++++++++++++++ .github/workflows/commit-lint.yml | 17 +++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .commitlintrc.json create mode 100644 .github/workflows/commit-lint.yml diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 00000000..8c6c4297 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,23 @@ +{ + "extends": ["@commitlint/config-conventional"], + "rules": { + "type-enum": [ + 2, + "always", + [ + "feat", + "fix", + "docs", + "style", + "refactor", + "perf", + "tests", + "build", + "ci", + "chore", + "cleanup" + ] + ], + "subject-case": [0] + } +} diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml new file mode 100644 index 00000000..c32dc3e8 --- /dev/null +++ b/.github/workflows/commit-lint.yml @@ -0,0 +1,17 @@ +name: "Commits" + +on: + pull_request: + branches: [master] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + # Applies to all commits + fetch-depth: 0 + + - name: "Conventional Commits" + uses: wagoid/commitlint-github-action@v6