[CI/Build] Add advisory PR title format check (#54263)

This commit is contained in:
Bugen Zhao
2026-08-28 15:50:47 -07:00
committed by GitHub
parent df14152ac6
commit b131311fb4
2 changed files with 49 additions and 18 deletions
+24
View File
@@ -0,0 +1,24 @@
name: PR title
on:
pull_request:
types: [opened, edited, reopened, synchronize]
permissions: {}
jobs:
check-format:
name: Check format
runs-on: ubuntu-latest
steps:
- name: Validate title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
pattern='^(\[[^][]+\])+ +[^[:space:]].*$'
if [[ "$PR_TITLE" =~ $pattern ]]; then
exit 0
fi
echo "::error::PR title must start with one or more [Tag] prefixes, followed by a space and a description."
exit 1