You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trimmed_title=$(echo "${PR_TITLE}" | sed -E "s/${WIP_REGEX}//" | sed -E "s/${TAG_REGEX}//" | xargs)
22
+
# Trim WIP and tags from title
23
+
trimmed_title=$(echo "${PR_TITLE}" | sed -E "s/${WIP_REGEX}//" | sed -E "s/${TAG_REGEX}//" | xargs)
24
24
25
-
# Normalize common emojis in text form to actual emojis
26
-
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:warning:/⚠/g")
27
-
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:sparkles:/✨/g")
28
-
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:bug:/🐛/g")
29
-
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:book:/📖/g")
30
-
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:rocket:/🚀/g")
31
-
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:seedling:/🌱/g")
25
+
# Normalize common emojis in text form to actual emojis
26
+
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:warning:/⚠/g")
27
+
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:sparkles:/✨/g")
28
+
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:bug:/🐛/g")
29
+
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:book:/📖/g")
30
+
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:rocket:/🚀/g")
31
+
trimmed_title=$(echo "$trimmed_title" | sed -E "s/:seedling:/🌱/g")
32
32
33
-
# Check PR type prefix
34
-
if [[ "${trimmed_title}" =~ ^(⚠|✨|🐛|📖|🚀|🌱) ]]; then
35
-
echo "PR title is valid: $trimmed_title"
36
-
else
37
-
echo "Error: No matching PR type indicator found in title."
38
-
echo "You need to have one of these as the prefix of your PR title:"
39
-
echo "- Breaking change: ⚠ (:warning:)"
40
-
echo "- Non-breaking feature: ✨ (:sparkles:)"
41
-
echo "- Patch fix: 🐛 (:bug:)"
42
-
echo "- Docs: 📖 (:book:)"
43
-
echo "- Release: 🚀 (:rocket:)"
44
-
echo "- Infra/Tests/Other: 🌱 (:seedling:)"
45
-
exit 1
46
-
fi
33
+
# Check PR type prefix
34
+
if [[ "${trimmed_title}" =~ ^(⚠|✨|🐛|📖|🚀|🌱) ]]; then
35
+
echo "PR title is valid: $trimmed_title"
36
+
else
37
+
echo "Error: No matching PR type indicator found in title."
38
+
echo "You need to have one of these as the prefix of your PR title:"
39
+
echo "- Breaking change: ⚠ (:warning:)"
40
+
echo "- Non-breaking feature: ✨ (:sparkles:)"
41
+
echo "- Patch fix: 🐛 (:bug:)"
42
+
echo "- Docs: 📖 (:book:)"
43
+
echo "- Release: 🚀 (:rocket:)"
44
+
echo "- Infra/Tests/Other: 🌱 (:seedling:)"
45
+
exit 1
46
+
fi
47
47
48
-
# Check that PR title does not contain Issue or PR number
49
-
if [[ "${trimmed_title}" =~ \#[0-9]+ ]]; then
50
-
echo "Error: PR title should not contain issue or PR number."
51
-
echo "Issue numbers belong in the PR body as either \"Fixes #XYZ\" (if it closes the issue or PR), or something like \"Related to #XYZ\" (if it's just related)."
52
-
exit 1
53
-
fi
48
+
# Check that PR title does not contain Issue or PR number
49
+
if [[ "${trimmed_title}" =~ \#[0-9]+ ]]; then
50
+
echo "Error: PR title should not contain issue or PR number."
51
+
echo "Issue numbers belong in the PR body as either \"Fixes #XYZ\" (if it closes the issue or PR), or something like \"Related to #XYZ\" (if it's just related)."
0 commit comments