From 4338c33272bce13681439bce5c14a2ff72da3920 Mon Sep 17 00:00:00 2001 From: Abdel792 Date: Sat, 23 May 2026 21:58:23 +0200 Subject: [PATCH] Push Crowdin translation updates to the current workflow branch This removes the dedicated l10n branch handling previously used during translation synchronization. Translation updates are now pushed directly to the branch checked out by the workflow instead of being force-pushed to l10n. Also removes the obsolete downloadTranslationsBranch workflow environment variable, which is no longer needed. Additionally, translation synchronization now performs a single final git push after all commits have been created, avoiding intermediate repository states during workflow execution. --- .github/scripts/crowdinSync.ps1 | 20 ++++++++++++++++---- .github/workflows/crowdinL10n.yml | 1 - 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/scripts/crowdinSync.ps1 b/.github/scripts/crowdinSync.ps1 index 9628dd9..63dafc8 100644 --- a/.github/scripts/crowdinSync.ps1 +++ b/.github/scripts/crowdinSync.ps1 @@ -53,7 +53,6 @@ if (Test-Path $xliffFile) { git diff --staged --quiet if ($LASTEXITCODE -ne 0) { git commit -m "Update $xliffFile for $addonId" - git push } } @@ -172,9 +171,22 @@ git add addon/locale addon/doc git diff --staged --quiet if ($LASTEXITCODE -ne 0) { git commit -m "Update translations for $addonId from Crowdin (Automatic Sync)" - $branch = $env:downloadTranslationsBranch - git push -f origin "HEAD:$branch" - Write-Host "SUCCESS: Translations committed and pushed." + Write-Host "SUCCESS: Translations committed." } else { Write-Host "DEBUG: No changes in translations to commit." } + +# Push all generated commits after successful Crowdin synchronization +$pushOutput = git push 2>&1 + +Write-Host $pushOutput + +if ($LASTEXITCODE -ne 0) { + Write-Host "ERROR: Failed to push commits to $repository." +} +elseif ($pushOutput -match "Everything up-to-date") { + Write-Host "INFO: No new commits needed to be pushed." +} +else { + Write-Host "SUCCESS: New commits successfully pushed to $repository." +} diff --git a/.github/workflows/crowdinL10n.yml b/.github/workflows/crowdinL10n.yml index 04b274a..c23978d 100644 --- a/.github/workflows/crowdinL10n.yml +++ b/.github/workflows/crowdinL10n.yml @@ -12,7 +12,6 @@ concurrency: env: crowdinAuthToken: ${{ secrets.CROWDIN_TOKEN }} - downloadTranslationsBranch: l10n GH_TOKEN: ${{ github.token }} CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID || 780748 }} L10N_UTIL_CONFIG: ${{ vars.L10N_UTIL_CONFIG || 'addon' }}