mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
41fc6908c2
Run required workflows for `merge_group` commits so the merge queue receives status checks. Keep PR-title validation and autofix publishing limited to pull request events. Validated with `just ready`. AI assistance was used for this change.
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Check PR
|
|
|
|
permissions: {}
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- edited
|
|
- synchronize
|
|
- reopened
|
|
merge_group:
|
|
|
|
jobs:
|
|
pr:
|
|
name: Check PR Title
|
|
runs-on: ubuntu-slim
|
|
steps:
|
|
- name: Validate PR title
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
env:
|
|
TITLE: ${{ github.event.pull_request.title }}
|
|
run: |
|
|
PATTERN='^(build|chore|ci|docs|feat|fix|perf|refactor|release|revert|style|test)\([a-z0-9/_-]+(, ?[a-z0-9/_-]+)*\)!?: .+'
|
|
if ! printf '%s' "$TITLE" | grep -Eq "$PATTERN"; then
|
|
{
|
|
echo "::error title=Invalid PR title::PR title must follow Conventional Commits with a required scope."
|
|
echo ""
|
|
echo "Got: $TITLE"
|
|
echo "Expected: <type>(<scope>): <subject> e.g. fix(parser): handle trailing comma"
|
|
echo ""
|
|
echo "Allowed types: build, chore, ci, docs, feat, fix, perf, refactor, release, revert, style, test"
|
|
echo "Scope chars: a-z 0-9 / _ - with comma-separated scopes allowed"
|
|
echo "Breaking: append ! before the colon (e.g. feat(ast)!: ...)"
|
|
} >&2
|
|
exit 1
|
|
fi
|
|
|
|
- name: Accept merge group
|
|
if: ${{ github.event_name == 'merge_group' }}
|
|
run: "true"
|