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 <jubalh@iodoru.org>
This commit is contained in:
Michael Vetter
2026-03-21 00:41:16 +01:00
parent d808b88b55
commit 9407eb958d
2 changed files with 40 additions and 0 deletions

23
.commitlintrc.json Normal file
View File

@@ -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]
}
}

17
.github/workflows/commit-lint.yml vendored Normal file
View File

@@ -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