From ef9df1683e5004de793b51deeecd3cc98899327b Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 5 Oct 2023 16:20:07 +0200 Subject: [PATCH] Fix: Only open/update issue when translations are needed Signed-off-by: Knut Ahlers --- .github/workflows/test-and-build.yml | 6 +++++- ci/translate/issue.tpl.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml index cfa7881..c36337f 100644 --- a/.github/workflows/test-and-build.yml +++ b/.github/workflows/test-and-build.yml @@ -71,9 +71,13 @@ jobs: - name: Generate (and validate) translations run: make translate + - name: Delete issue template when no languages require translation + run: | + grep -q "### Language" translate-issue.md || rm -f translate-issue.md + - name: Update Translations Issue uses: JasonEtco/create-an-issue@v2 - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' && hashFiles('translate-issue.md') != '' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/ci/translate/issue.tpl.md b/ci/translate/issue.tpl.md index 72bfeea..1704d33 100644 --- a/ci/translate/issue.tpl.md +++ b/ci/translate/issue.tpl.md @@ -5,7 +5,7 @@ title: Missing Translations **In order to achieve this we need to fix the following missing translations.** -To do so please either **create a pull-request** updating the `i18n.yaml` in the root of the repository and add the missing translations to the corresponding language or **just leave a comment** below and ping @Luzifer in your comment. He then will integrate the new translation strings and mark your comment hidden after this issue has been automatically updated (kind of a to-do list for translations until we have something better in place). +To help translating please either **create a pull-request** updating the `i18n.yaml` in the root of the repository and add the missing translations to the corresponding language or **just leave a comment** below and ping @Luzifer in your comment. He then will integrate the new translation strings and mark your comment hidden after this issue has been automatically updated (kind of a to-do list for translations until we have something better in place). {{ range $lang, $translation := .Translations -}} {{ if MissingTranslations $lang -}}