File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 name : Verify Pull Request
1010 if : github.event_name != 'pull_request' || !github.event.pull_request.draft
1111 steps :
12- - name : Verifier action
13- id : verifier
14- uses : kubernetes-sigs/kubebuilder-release-tools@012269a88fa4c034a0acf1ba84c26b195c0dbab4 # v0.4.3
15- with :
16- github_token : ${{ secrets.GITHUB_TOKEN }}
12+ - name : Validate PR Title Format
13+ env :
14+ TITLE : ${{ github.event.pull_request.title }}
15+ run : |
16+ if [[ -z "$TITLE" ]]; then
17+ echo "Error: PR title cannot be empty."
18+ exit 1
19+ fi
20+
21+ if ! [[ "$TITLE" =~ ^($'\u26A0'|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F680'|$'\U0001F331') ]]; then
22+ echo "Error: Invalid PR title format."
23+ echo "Your PR title must start with one of the following indicators:"
24+ echo "- Breaking change: ⚠ (U+26A0)"
25+ echo "- Non-breaking feature: ✨ (U+2728)"
26+ echo "- Patch fix: 🐛 (U+1F41B)"
27+ echo "- Docs: 📖 (U+1F4D6)"
28+ echo "- Release: 🚀 (U+1F680)"
29+ echo "- Infra/Tests/Other: 🌱 (U+1F331)"
30+ exit 1
31+ fi
32+
33+ echo "PR title is valid: '$TITLE'"
1734
1835 - name : Checkout repository
1936 uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
You can’t perform that action at this time.
0 commit comments