Skip to content

Commit

Permalink
Fix add-lang script 2 (jamulussoftware#1021)
Browse files Browse the repository at this point in the history
* Update add-lang.yml

* Update add-lang.yml

* Update add-lang.yml
  • Loading branch information
ignotus666 authored Aug 5, 2024
1 parent 4edbedc commit 628943e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/add-lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 628943e

Please sign in to comment.