Skip to content

Commit 1fb76a7

Browse files
🌱 fix PR title check (#4596)
fix PR title check
1 parent 6f73250 commit 1fb76a7

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

.github/workflows/verify.yml

+15-25
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,23 @@ jobs:
1414

1515
- name: Validate PR Title Format
1616
run: |
17-
# Extract raw PR title
18-
RAW_TITLE="${{ github.event.pull_request.title }}"
19-
20-
# Ensure title is not empty
21-
if [[ -z "$RAW_TITLE" ]]; then
22-
echo "❌ Error: PR title cannot be empty."
17+
TITLE="${{ github.event.pull_request.title }}"
18+
19+
if [[ -z "$TITLE" ]]; then
20+
echo "Error: PR title cannot be empty."
2321
exit 1
2422
fi
25-
26-
# Enforce strict format (must start with one of the required emojis)
27-
if ! [[ "$RAW_TITLE" =~ ^(⚠|✨|🐛|📖|🚀|🌱) ]]; then
28-
echo "❌ Error: Invalid PR title format."
23+
24+
if ! [[ "$TITLE" =~ ^($'\u26A0'|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F680'|$'\U0001F331') ]]; then
25+
echo "Error: Invalid PR title format."
2926
echo "Your PR title must start with one of the following indicators:"
30-
echo "- Breaking change: ⚠ (:warning:)"
31-
echo "- Non-breaking feature: ✨ (:sparkles:)"
32-
echo "- Patch fix: 🐛 (:bug:)"
33-
echo "- Docs: 📖 (:book:)"
34-
echo "- Release: 🚀 (:rocket:)"
35-
echo "- Infra/Tests/Other: 🌱 (:seedling:)"
36-
exit 1
37-
fi
38-
39-
# Ensure title does not exceed 100 characters
40-
if [[ ${#RAW_TITLE} -gt 100 ]]; then
41-
echo "❌ Error: PR title is too long (max 100 characters)."
27+
echo "- Breaking change: ⚠ (U+26A0)"
28+
echo "- Non-breaking feature: ✨ (U+2728)"
29+
echo "- Patch fix: 🐛 (U+1F41B)"
30+
echo "- Docs: 📖 (U+1F4D6)"
31+
echo "- Release: 🚀 (U+1F680)"
32+
echo "- Infra/Tests/Other: 🌱 (U+1F331)"
4233
exit 1
4334
fi
44-
45-
# Confirm PR title is valid
46-
echo "✅ PR title is valid: '$RAW_TITLE'"
35+
36+
echo "PR title is valid: '$TITLE'"

0 commit comments

Comments
 (0)