From 39659fb1c469bdf97cca5c714f00d3ea91235bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Fri, 10 Apr 2026 10:14:29 +0200 Subject: [PATCH 1/3] ci: open PR for translation updates instead of pushing directly --- .github/workflows/translate.yml | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/translate.yml diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml new file mode 100644 index 00000000000..5596371eaea --- /dev/null +++ b/.github/workflows/translate.yml @@ -0,0 +1,54 @@ +name: "Update translations" + +on: + workflow_dispatch: + schedule: + - cron: "0 3 * * *" + +permissions: {} + +jobs: + update-translations: + permissions: + contents: read + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: l10n-push-source + uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2 + with: + token: ${{ secrets.TX_TOKEN }} + args: push -s + + - name: fix-transifex-action + run: rm -rf /tmp/tx + + - name: l10n-pull + uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2 + with: + token: ${{ secrets.TX_TOKEN }} + args: pull --force --all --silent + + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6 + with: + app-id: ${{ secrets.TRANSLATION_APP_ID }} + private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }} + + - name: Create or update translations PR + uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 + with: + token: ${{ steps.app-token.outputs.token }} + branch: chore/translations-update + base: master + commit-message: "chore: update translations from transifex" + title: "chore: update translations from transifex" + body: "Automated translation update from Transifex. This pull request is updated on each sync run — merging it will close it and a fresh one will be opened on the next change." + delete-branch: true + sign-commits: true From 4df9c156f90ad4f64e04b874d5d0fbd4f24551af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:42:15 +0200 Subject: [PATCH 2/3] ci: also trigger translation workflow on pull request for testing --- .github/workflows/translate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 5596371eaea..f8f2bc2c0f7 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -4,6 +4,9 @@ on: workflow_dispatch: schedule: - cron: "0 3 * * *" + pull_request: + branches: + - master permissions: {} From c3fd3fe0580f5a59e665b885419161512c72e6c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Fri, 10 Apr 2026 14:09:02 +0200 Subject: [PATCH 3/3] ci: use reusable translation-sync workflow --- .github/workflows/translate.yml | 51 ++++++--------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index f8f2bc2c0f7..9d2d703bfb5 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -12,46 +12,11 @@ permissions: {} jobs: update-translations: - permissions: - contents: read - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - persist-credentials: false - - - name: l10n-push-source - uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2 - with: - token: ${{ secrets.TX_TOKEN }} - args: push -s - - - name: fix-transifex-action - run: rm -rf /tmp/tx - - - name: l10n-pull - uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2 - with: - token: ${{ secrets.TX_TOKEN }} - args: pull --force --all --silent - - - name: Generate GitHub App token - id: app-token - uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6 - with: - app-id: ${{ secrets.TRANSLATION_APP_ID }} - private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }} - - - name: Create or update translations PR - uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 - with: - token: ${{ steps.app-token.outputs.token }} - branch: chore/translations-update - base: master - commit-message: "chore: update translations from transifex" - title: "chore: update translations from transifex" - body: "Automated translation update from Transifex. This pull request is updated on each sync run — merging it will close it and a fresh one will be opened on the next change." - delete-branch: true - sign-commits: true + uses: owncloud/reusable-workflows/.github/workflows/translation-sync.yml@main + with: + mode: native + sub_path: . + secrets: + TX_TOKEN: ${{ secrets.TX_TOKEN }} + TRANSLATION_APP_ID: ${{ secrets.TRANSLATION_APP_ID }} + TRANSLATION_APP_PRIVATE_KEY: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }}