From 67e4d9afc412c214864322afe5487b6a4b5fed07 Mon Sep 17 00:00:00 2001 From: Jonah Aragon Date: Fri, 24 Feb 2023 16:05:55 -0600 Subject: [PATCH] Update GitHub Workflows (#2023) --- .github/workflows/crowdin-download.yml | 35 +++++++++++++++++++ .../{crowdin.yml => crowdin-upload.yml} | 8 +++-- crowdin.yml | 6 ++-- 3 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/crowdin-download.yml rename .github/workflows/{crowdin.yml => crowdin-upload.yml} (84%) diff --git a/.github/workflows/crowdin-download.yml b/.github/workflows/crowdin-download.yml new file mode 100644 index 0000000000..e2172a0f59 --- /dev/null +++ b/.github/workflows/crowdin-download.yml @@ -0,0 +1,35 @@ +name: 💬 Crowdin Download + +on: + workflow_dispatch: + release: + types: [ published ] + +permissions: write-all + +jobs: + synchronize-with-crowdin: + runs-on: ubuntu-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: crowdin action + uses: crowdin/github-action@v1.7.0 + with: + upload_sources: true + upload_sources_args: '--auto-update --delete-obsolete' + upload_translations: false + download_translations: true + localization_branch_name: crowdin/l10n_translations + create_pull_request: true + pull_request_title: 'New Crowdin Translations' + pull_request_body: 'New Crowdin translations by [Crowdin GitHub Action](https://github.com/crowdin/github-action)' + pull_request_base_branch_name: 'jonaharagon/i18n-test2' + config: crowdin.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin-upload.yml similarity index 84% rename from .github/workflows/crowdin.yml rename to .github/workflows/crowdin-upload.yml index 3743ec7caf..479b9c9586 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin-upload.yml @@ -2,8 +2,12 @@ name: 💬 Crowdin Upload on: workflow_dispatch: - release: - types: [published] + push: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: synchronize-with-crowdin: diff --git a/crowdin.yml b/crowdin.yml index af7eeda29f..a191710a6b 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -3,16 +3,16 @@ api_token_env: CROWDIN_PERSONAL_TOKEN "preserve_hierarchy": true files: - source: "/docs/**/*.en.*" - translation: "/docs/**/%file_name%.%locale_with_underscore%.%file_extension%" + translation: "/docs/**/%file_name%.%two_letters_code%.%file_extension%" translation_replace: "en.": "" update_option: update_as_unapproved - source: "/theme/overrides/*.en.html" - translation: "/theme/overrides/%file_name%.%locale_with_underscore%.html" + translation: "/theme/overrides/%file_name%.%two_letters_code%.html" translation_replace: "en.": "" - source: "/includes/*.en.md" - translation: "/includes/%file_name%.%locale_with_underscore%.md" + translation: "/includes/%file_name%.%two_letters_code%.md" translation_replace: "en.": "" update_option: update_as_unapproved