From 62400a622376f8b474d5c6831e2f13631b38c764 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Fri, 22 May 2026 12:36:31 +0300 Subject: [PATCH] =?UTF-8?q?ci(053):=20commitlint=20=E2=80=94=20enforce=20C?= =?UTF-8?q?onventional=20Commit=20PR=20titles=20(WP-C5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds .github/workflows/commitlint.yml which validates the PR title against the Conventional Commits spec on every pull_request event (opened, edited, synchronize). Uses amannn/action-semantic-pull-request@v5.5.3 (SHA-pinned per WP-B5 convention). Allowed types match repo usage: feat, fix, docs, chore, ci, refactor, test, perf, build, style, revert. Scope is optional. requireScope: false. Squash-merge friendly: only the PR title is checked (which becomes the squash commit message), so local commit messages are unaffected. --- .github/workflows/commitlint.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 00000000..61dbd1c9 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,39 @@ +name: Commitlint + +on: + pull_request: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + statuses: write + +jobs: + validate-pr-title: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - name: Check PR title follows Conventional Commits + uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Allowed Conventional Commit types for this repo. + # Keep in sync with the types used in squash-merge commit messages. + types: | + feat + fix + docs + chore + ci + refactor + test + perf + build + style + revert + # Scope is optional; allow any scope string when present. + requireScope: false