From 80f1198bfdd02392ec383e5fcc755507ef8580b3 Mon Sep 17 00:00:00 2001 From: sashamishcheriakova <135987917+sashamishcheriakova@users.noreply.github.com> Date: Thu, 20 Nov 2025 13:46:28 +0000 Subject: [PATCH] Update github actions --- .github/workflows/download-translations.yml | 43 +++++++++++++++++---- .github/workflows/upload-sources.yml | 8 ++++ 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/.github/workflows/download-translations.yml b/.github/workflows/download-translations.yml index 338dcdf..7f3b622 100644 --- a/.github/workflows/download-translations.yml +++ b/.github/workflows/download-translations.yml @@ -5,6 +5,12 @@ on: # Run every day at 1 AM UTC - cron: "0 1 * * *" workflow_dispatch: # Manual triggering + inputs: + language_code: + description: 'Language code to download translations for (leave empty to download all languages)' + required: false + default: '' + type: string concurrency: group: crowdin-download @@ -22,23 +28,46 @@ jobs: echo "Skipping Crowdin sync — no project ID set." exit 0 fi + - name: Checkout uses: actions/checkout@v4 with: ref: master - - name: Synchronize with Crowdin + - name: Download all translations from Crowdin uses: crowdin/github-action@v2 with: - upload_sources: false - upload_translations: false + create_pull_request: true + crowdin_branch_name: master download_translations: true localization_branch_name: l10n_crowdin_translations - create_pull_request: true - pull_request_title: "New Crowdin translations" - pull_request_body: "New Crowdin pull request with translations" pull_request_base_branch_name: "master" + pull_request_body: "New Crowdin pull request with translations" + pull_request_title: "New Crowdin translations" + upload_sources: false + upload_translations: false env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ inputs.language_code == '' }} + + - name: Download selected translations from Crowdin + uses: crowdin/github-action@v2 + with: + create_pull_request: true + crowdin_branch_name: master + download_language: ${{ inputs.language_code }} + download_translations: true + localization_branch_name: l10n_crowdin_translations-${{ inputs.language_code }} + pull_request_base_branch_name: "master" + pull_request_body: "New Crowdin pull request with translations" + pull_request_title: "New Crowdin translations for ${{ inputs.language_code }}" + upload_sources: false + upload_translations: false + env: CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ inputs.language_code != '' }} + diff --git a/.github/workflows/upload-sources.yml b/.github/workflows/upload-sources.yml index 23b4468..28af698 100644 --- a/.github/workflows/upload-sources.yml +++ b/.github/workflows/upload-sources.yml @@ -17,9 +17,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Make sure CROWDIN_PROJECT_ID is set + run: | + if [ -z "${{ secrets.CROWDIN_PROJECT_ID }}" ]; then + echo "CROWDIN_PROJECT_ID is not set. Please see instructions in CROWDIN.md" + exit 1 + fi + - name: Crowdin push uses: crowdin/github-action@v2 with: + crowdin_branch_name: master upload_sources: true upload_translations: false download_translations: false