From c521228bc009e6232f580f719de288d427e50269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NEDJAR?= Date: Tue, 24 Mar 2026 13:26:36 +0100 Subject: [PATCH 1/2] ci: Replace regex commit checker with commitlint. --- .github/workflows/check-commits.yml | 31 +++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check-commits.yml b/.github/workflows/check-commits.yml index 15d9fefe..9d761273 100644 --- a/.github/workflows/check-commits.yml +++ b/.github/workflows/check-commits.yml @@ -14,22 +14,19 @@ jobs: check-commit-messages: runs-on: ubuntu-latest steps: - - name: "📜 Check commit messages format" - uses: gsactions/commit-message-checker@v1 + - name: "⏳ Checkout repository" + uses: actions/checkout@v4 with: - pattern: '^[^!]+: [A-Za-z]+.+ .+\.$' - flags: "gm" - error: "Commit subject line must match the following pattern: : ." - excludeTitle: "false" - excludeDescription: "true" - checkAllCommitMessages: "true" - accessToken: ${{ secrets.GITHUB_TOKEN }} - - name: "📜 Check commit messages length" - uses: gsactions/commit-message-checker@v1 + fetch-depth: 0 + + - name: "🟢 Set up Node.js" + uses: actions/setup-node@v4 with: - pattern: "^[^#].{10,78}$" - error: "Commit subject line maximum line length of 78 characters is exceeded." - excludeTitle: "false" - excludeDescription: "true" - checkAllCommitMessages: "true" - accessToken: ${{ secrets.GITHUB_TOKEN }} + node-version: "20" + cache: "npm" + + - name: "🛠 Install commitlint" + run: npm ci + + - name: "📜 Validate commit messages" + run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose From bd424caa8ab4896cfc8245d67d56be3442e011f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NEDJAR?= Date: Tue, 24 Mar 2026 13:39:07 +0100 Subject: [PATCH 2/2] ci: Address Copilot review on commitlint workflow. --- .github/workflows/check-commits.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-commits.yml b/.github/workflows/check-commits.yml index 9d761273..3b1e9241 100644 --- a/.github/workflows/check-commits.yml +++ b/.github/workflows/check-commits.yml @@ -22,11 +22,11 @@ jobs: - name: "🟢 Set up Node.js" uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "20.17.x" cache: "npm" - name: "🛠 Install commitlint" - run: npm ci + run: npm ci --ignore-scripts - name: "📜 Validate commit messages" - run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx --no-install commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose