From 05403ae247f509a953d476db0dea2f5d21f0dd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Tue, 11 Feb 2025 15:58:17 +0100 Subject: [PATCH] I18n CI (#10129) --- .github/workflows/i18n-push.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/i18n-push.yaml b/.github/workflows/i18n-push.yaml index 00c814604..69b251c3e 100644 --- a/.github/workflows/i18n-push.yaml +++ b/.github/workflows/i18n-push.yaml @@ -21,13 +21,16 @@ jobs: uses: actions/checkout@v4 with: token: ${{ github.token }} - ref: i18n + ref: main - - name: Merge main into i18n + - name: Setup i18n branch run: | - git fetch origin main - git checkout i18n - git merge origin/main + if ! git ls-remote --heads origin i18n | grep i18n; then + git checkout -b i18n + else + git checkout i18n + git merge origin/main + fi - name: Install dependencies uses: ./.github/workflows/actions/yarn-install @@ -49,12 +52,15 @@ jobs: git add . if ! git diff --staged --quiet --exit-code; then git commit -m "chore: extract translations" - git push origin HEAD:i18n echo "changes_detected=true" >> $GITHUB_OUTPUT else echo "changes_detected=false" >> $GITHUB_OUTPUT fi + - name: Push changes and create remote branch if needed + if: steps.check_changes.outputs.changes_detected == 'true' + run: git push origin HEAD:i18n + - name: Upload missing translations if: steps.check_changes.outputs.changes_detected == 'true' uses: crowdin/github-action@v2