@@ -14,33 +14,23 @@ jobs:
14
14
15
15
- name : Validate PR Title Format
16
16
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."
23
21
exit 1
24
22
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."
29
26
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)"
42
33
exit 1
43
34
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