From 299667685e5ec5edb8975a91f160d135bb282f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=A3=20Bida=20Vacaro?= Date: Fri, 30 Oct 2026 17:53:04 -0300 Subject: [PATCH] fix(ci): validate commit messages for semantic-release --- .commitlintrc.json | 3 +++ .github/workflows/commitlint.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .commitlintrc.json create mode 100644 .github/workflows/commitlint.yml diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 00000000..c30e5a97 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["@commitlint/config-conventional"] +} diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 00000000..0978cbc0 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,29 @@ +name: commitlint + +on: + pull_request: + branches: [main] + +jobs: + commitlint: + name: Validate commit messages + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install commitlint + run: npm install --no-save @commitlint/cli @commitlint/config-conventional + + - name: Lint commits + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: npx commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose