From 62f5aad703a5164ae4aa094e9da45482bc83948e Mon Sep 17 00:00:00 2001 From: ignotus Date: Mon, 5 Aug 2024 10:45:09 +0200 Subject: [PATCH 1/3] Update add-lang.yml --- .github/workflows/add-lang.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/add-lang.yml b/.github/workflows/add-lang.yml index c9c2c0ab9..f6cd7a3cc 100644 --- a/.github/workflows/add-lang.yml +++ b/.github/workflows/add-lang.yml @@ -19,14 +19,15 @@ 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 - else - echo Error: language name/code in wrong format. - exit 1 - fi + 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/code in wrong format." + exit 1 + fi # Check out repo: - uses: actions/checkout@v4 From e0312015e133c5116e6c5a4af02b6081186a5de3 Mon Sep 17 00:00:00 2001 From: ignotus Date: Mon, 5 Aug 2024 10:56:13 +0200 Subject: [PATCH 2/3] Update add-lang.yml --- .github/workflows/add-lang.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/add-lang.yml b/.github/workflows/add-lang.yml index f6cd7a3cc..20e5109eb 100644 --- a/.github/workflows/add-lang.yml +++ b/.github/workflows/add-lang.yml @@ -28,6 +28,7 @@ jobs: echo "Error: language name/code in wrong format." exit 1 fi + fi # Check out repo: - uses: actions/checkout@v4 From c266396b632529eb43d48c5e84be33764f0ba3d3 Mon Sep 17 00:00:00 2001 From: ignotus Date: Mon, 5 Aug 2024 11:05:14 +0200 Subject: [PATCH 3/3] Update add-lang.yml --- .github/workflows/add-lang.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add-lang.yml b/.github/workflows/add-lang.yml index 20e5109eb..ba9e82110 100644 --- a/.github/workflows/add-lang.yml +++ b/.github/workflows/add-lang.yml @@ -25,9 +25,12 @@ jobs: echo "full_lang=$FULL_LANG" >> $GITHUB_ENV echo "issue_num=$ISSUE_NUM" >> $GITHUB_ENV else - echo "Error: language name/code in wrong format." + echo Error: language name in wrong format. exit 1 fi + else + echo Error: language code in wrong format. + exit 1 fi # Check out repo: