From 2c6f38d1599761adb25e34018c322162ff669300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Murta?= Date: Sat, 21 Jun 2025 19:41:58 +0100 Subject: [PATCH] ci: add commitlint action To check that commits are according to the Conventional Commits spec. https://www.conventionalcommits.org/en/v1.0.0/ --- .github/workflows/commitlint.config.js | 3 +++ .github/workflows/lint-pr.yml | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/commitlint.config.js create mode 100644 .github/workflows/lint-pr.yml diff --git a/.github/workflows/commitlint.config.js b/.github/workflows/commitlint.config.js new file mode 100644 index 0000000..b29b5ae --- /dev/null +++ b/.github/workflows/commitlint.config.js @@ -0,0 +1,3 @@ +export default { + extends: ["@commitlint/config-conventional"], +}; diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000..06e7e33 --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,20 @@ +name: Lint PR + +on: + pull_request: + branches: ["main"] + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - run: >- + npx commitlint + -g .github/workflows/commitlint.config.js + --from ${{ gitea.event.pull_request.base.sha }} + --to ${{ gitea.event.pull_request.head.sha }} + --verbose