From e10030e2b345e9a92383c65302d55271e2055a76 Mon Sep 17 00:00:00 2001 From: JeanExtreme002 Date: Wed, 13 May 2026 02:02:09 -0300 Subject: [PATCH] ci: lint PR titles with conventional commit rules Adds a workflow that runs amannn/action-semantic-pull-request on PR open/edit/synchronize/reopen. The accepted types mirror the set the existing PR labeler already recognizes (feat, fix, perf, refactor, revert, docs, ci, build) plus chore/test/style. Subjects must start lowercase and not end with a period. Scopes are not constrained. --- .github/workflows/lint-pr-title.yml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/lint-pr-title.yml diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 0000000..3735fd2 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,46 @@ +name: Lint PR title + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +permissions: + pull-requests: read + +jobs: + lint: + name: Conventional commit title + runs-on: ubuntu-latest + steps: + - name: Lint PR title + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Conventional commit types accepted in titles. Mirrors the set the + # PR labeler recognizes in .github/workflows/labeler.yml. + types: | + feat + fix + perf + refactor + revert + docs + ci + build + chore + test + style + # Subject must start lowercase and not end with a period. + subjectPattern: ^(?![A-Z])(?!.*\.$).+$ + subjectPatternError: | + The subject "{subject}" found in "{title}" must start with a + lowercase letter and must not end with a period.