Skip to content

Commit 628943e

Browse files
authored
Fix add-lang script 2 (#1021)
* Update add-lang.yml * Update add-lang.yml * Update add-lang.yml
1 parent 4edbedc commit 628943e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/add-lang.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ jobs:
1919
run: |
2020
LANG_CODE=$(sed 's/.*\[\([^]]*\)].*/\1/' <<< "$ISSUE_TITLE")
2121
FULL_LANG=$(sed 's/.*<\([^>]*\)>.*/\1/' <<< "$ISSUE_TITLE")
22-
if [[ "$LANG_CODE" =~ ^[a-z]{2}(-[A-Z]{2})?$ && "$ISSUE_TITLE" =~ <[^>]+> ]]; then
23-
echo "lang_code=$LANG_CODE" >> $GITHUB_ENV
24-
echo "full_lang=$FULL_LANG" >> $GITHUB_ENV
25-
echo "issue_num=$ISSUE_NUM" >> $GITHUB_ENV
22+
if [[ "$LANG_CODE" =~ ^[a-z]{2}(-[A-Z]{2})?$ ]]; then
23+
if echo "$ISSUE_TITLE" | grep -q '<[^>]\+>'; then
24+
echo "lang_code=$LANG_CODE" >> $GITHUB_ENV
25+
echo "full_lang=$FULL_LANG" >> $GITHUB_ENV
26+
echo "issue_num=$ISSUE_NUM" >> $GITHUB_ENV
27+
else
28+
echo Error: language name in wrong format.
29+
exit 1
30+
fi
2631
else
27-
echo Error: language name/code in wrong format.
32+
echo Error: language code in wrong format.
2833
exit 1
2934
fi
3035

0 commit comments

Comments
 (0)