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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
bc13417448
commit
7aea4942d7
+17
-2
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user