Skip to content

Commit eb0f00b

Browse files
🌱 ci: Normalize text-based emoji codes to actual emojis in PR title checker (#4097)
ci: Normalize text-based emoji codes to actual emojis in PR title checker Follow up of: #4095
1 parent 547b2f3 commit eb0f00b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hack/ci/pr_title_checker.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ PR_TITLE="$1"
2222
# Trim WIP and tags from title
2323
trimmed_title=$(echo "$PR_TITLE" | sed -E "s/$WIP_REGEX//" | sed -E "s/$TAG_REGEX//" | xargs)
2424

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+
2533
# Check PR type prefix
2634
if [[ "$trimmed_title" =~ ^⚠ ]] || [[ "$trimmed_title" =~ ^✨ ]] || [[ "$trimmed_title" =~ ^🐛 ]] || [[ "$trimmed_title" =~ ^📖 ]] || [[ "$trimmed_title" =~ ^🚀 ]] || [[ "$trimmed_title" =~ ^🌱 ]]; then
2735
echo "PR title is valid: $trimmed_title"

0 commit comments

Comments
 (0)