From 7ece495f4471a1a9fe5b625592115012f8205705 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Sat, 20 Dec 2025 21:37:17 +0800 Subject: [PATCH] chore(ci): adjust crowdin workflows Co-authored-by: Typed SIGTERM <145281501+typed-sigterm@users.noreply.github.com> --- .../{crowdin.yaml => crowdin-cron-sync.yml} | 4 +-- .github/workflows/crowdin-manual-upload.yml | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) rename .github/workflows/{crowdin.yaml => crowdin-cron-sync.yml} (81%) create mode 100644 .github/workflows/crowdin-manual-upload.yml diff --git a/.github/workflows/crowdin.yaml b/.github/workflows/crowdin-cron-sync.yml similarity index 81% rename from .github/workflows/crowdin.yaml rename to .github/workflows/crowdin-cron-sync.yml index 78eac2c4a..415fafc9d 100644 --- a/.github/workflows/crowdin.yaml +++ b/.github/workflows/crowdin-cron-sync.yml @@ -1,4 +1,4 @@ -name: Sync Translations from Crowdin +name: Crowdin sync translations from remote on: schedule: @@ -23,7 +23,7 @@ jobs: create_pull_request: true commit_message: 'chore(i18n): update translations' pull_request_title: 'chore(i18n): update translations' - pull_request_body: 'This PR contains updated translations from Crowdin. Created from [GitHub Actions](https://github.com/moeru-ai/airi/blob/main/.github/workflows/crowdin.yaml).\n\n You can review the source of translations [here](https://crowdin.com/project/proj-airi)' + pull_request_body: 'This PR contains updated translations from Crowdin. Created from [GitHub Actions](https://github.com/moeru-ai/airi/blob/main/.github/workflows/crowdin-cron-sync.yml).\n\n You can review the source of translations [here](https://crowdin.com/project/proj-airi)' pull_request_base_branch_name: main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/crowdin-manual-upload.yml b/.github/workflows/crowdin-manual-upload.yml new file mode 100644 index 000000000..a75b72897 --- /dev/null +++ b/.github/workflows/crowdin-manual-upload.yml @@ -0,0 +1,25 @@ +name: Crowdin upload translations to remote + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + upload-translations-to-crowdin: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # NOTICE: Uploading local translations to Crowdin can overwrite remote changes and discard pending sync work. Run only when intentionally pushing the repo state upstream. See https://github.com/moeru-ai/airi/pull/813#issuecomment-3669328994 and https://support.crowdin.com/enterprise/github-integration/ (explained by @typed-sigterm); Mastodon follows a similar flow. + - uses: crowdin/github-action@v2 + with: + upload_sources: false + upload_translations: true + download_translations: false + localization_branch_name: crowdin + create_pull_request: false + commit_message: 'chore(i18n): push translations to crowdin' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}