Files
Zhiwei Yin ccd6ae42be 🐛 Align PR title verifier prefixes with pull_request_template.md (#1417)
The Docker image gcr.io/kubebuilder/pr-verifier:v0.4.3 used by
kubernetes-sigs/kubebuilder-release-tools has been removed from GCR
as of March 2025. Replace it with an inline shell script that validates
PR title format, matching the prefixes defined in pull_request_template.md.
Both emoji shortcodes (e.g. 🐛) and unicode emoji are accepted.

Signed-off-by: Zhiwei Yin <zyin@redhat.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-09 08:20:03 +00:00

38 lines
1.2 KiB
YAML

name: PR Verifier
on:
pull_request:
types: [opened, edited, reopened, synchronize]
permissions:
contents: read
jobs:
verify:
name: verify PR contents
runs-on: ubuntu-latest
steps:
- name: Verifier action
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ -z "$TITLE" ]]; then
echo "Error: PR title cannot be empty."
exit 1
fi
if ! [[ "$TITLE" =~ ^(:sparkles:|:bug:|:book:|:memo:|:warning:|:seedling:|:question:|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F4DD'|$'\u26A0'$'\uFE0F'?|$'\U0001F331'|$'\u2753') ]]; then
echo "Error: Invalid PR title format."
echo "Your PR title must start with one of the following indicators:"
echo "- :sparkles: ✨ feature"
echo "- :bug: 🐛 bug fix"
echo "- :book: 📖 docs"
echo "- :memo: 📝 proposal"
echo "- :warning: ⚠️ breaking change"
echo "- :seedling: 🌱 other/misc"
echo "- :question: ❓ requires manual review"
exit 1
fi
echo "PR title is valid: '$TITLE'"