[CI/Build] Add advisory PR title format check (#54263)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user