From 7aea4942d7ae6633d911bafcad3debdd2e278e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 27 Mar 2026 08:11:51 +0000 Subject: [PATCH] chore: add pr title validation to ci (#3702) ## Summary - Adds a `pr-title` CI job that validates PR titles start with `feat:`, `fix:`, `test:`, `chore:`, or `showcase:` and are all lowercase - Updates `.github/CONTRIBUTING.md` with the title format rules and a link to the full contributing docs --------- Co-authored-by: Claude Opus 4.6 (1M context) --- .github/CONTRIBUTING.md | 19 +++++++++++++++++-- .github/workflows/ci.yml | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 98186a54..c1a99446 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,5 +1,20 @@ # Contributing Guidelines -## Submitting a pull request +For the full contributing guide, see the +[Fresh documentation](https://fresh.deno.dev/docs/latest/contributing). -First, please be sure to ensure `deno task ok` is run and successfully passes. +## PR title format + +PR titles must be all lowercase and start with one of the following prefixes: + +- `feat:` - new features +- `fix:` - bug fixes +- `test:` - test additions or changes +- `chore:` - maintenance, refactoring, docs +- `ci:` - CI/CD changes + +Example: `feat: add middleware compilation` + +## Before submitting + +Run `deno task ok` and ensure it passes. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 885de7e7..feefa26b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,23 @@ on: branches: [main] jobs: + pr-title: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Validate PR title + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + if ! echo "$TITLE" | grep -qP '^(feat|fix|test|chore|ci):'; then + echo "::error::PR title must start with feat:, fix:, test:, chore:, or ci:" + exit 1 + fi + if echo "$TITLE" | grep -qP '[A-Z]'; then + echo "::error::PR title must be all lowercase" + exit 1 + fi + test: runs-on: ${{ matrix.os }} timeout-minutes: 10