diff --git a/.github/workflows/add-lang.yml b/.github/workflows/add-lang.yml index c9c2c0ab9..ba9e82110 100644 --- a/.github/workflows/add-lang.yml +++ b/.github/workflows/add-lang.yml @@ -19,12 +19,17 @@ jobs: run: | LANG_CODE=$(sed 's/.*\[\([^]]*\)].*/\1/' <<< "$ISSUE_TITLE") FULL_LANG=$(sed 's/.*<\([^>]*\)>.*/\1/' <<< "$ISSUE_TITLE") - if [[ "$LANG_CODE" =~ ^[a-z]{2}(-[A-Z]{2})?$ && "$ISSUE_TITLE" =~ <[^>]+> ]]; then - echo "lang_code=$LANG_CODE" >> $GITHUB_ENV - echo "full_lang=$FULL_LANG" >> $GITHUB_ENV - echo "issue_num=$ISSUE_NUM" >> $GITHUB_ENV + if [[ "$LANG_CODE" =~ ^[a-z]{2}(-[A-Z]{2})?$ ]]; then + if echo "$ISSUE_TITLE" | grep -q '<[^>]\+>'; then + echo "lang_code=$LANG_CODE" >> $GITHUB_ENV + echo "full_lang=$FULL_LANG" >> $GITHUB_ENV + echo "issue_num=$ISSUE_NUM" >> $GITHUB_ENV + else + echo Error: language name in wrong format. + exit 1 + fi else - echo Error: language name/code in wrong format. + echo Error: language code in wrong format. exit 1 fi