From d7069c2754745f8d7d9cc6d65bda756c845900fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E7=8C=AB?= Date: Fri, 13 Mar 2026 05:09:17 +0900 Subject: [PATCH] tmp: add to default branch to run --- .github/workflows/crowdin-bootstrap.yml | 64 +++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/crowdin-bootstrap.yml diff --git a/.github/workflows/crowdin-bootstrap.yml b/.github/workflows/crowdin-bootstrap.yml new file mode 100644 index 00000000..99e6895e --- /dev/null +++ b/.github/workflows/crowdin-bootstrap.yml @@ -0,0 +1,64 @@ +name: Crowdin Bootstrap Target Translations + +on: + workflow_dispatch: + inputs: + base_branch: + description: "Repository branch whose committed target translations should be bootstrapped into Crowdin." + required: true + type: choice + options: + - main + - r-dev + confirm_bootstrap: + description: "Explicit confirmation for the one-time or exceptional bootstrap upload." + required: true + type: choice + options: + - "no" + - "yes-bootstrap-current-target-translations" + +permissions: + contents: read + +jobs: + bootstrap-target-translations: + runs-on: ubuntu-24.04 + + steps: + - name: Require explicit bootstrap confirmation + if: inputs.confirm_bootstrap != 'yes-bootstrap-current-target-translations' + run: | + echo "This workflow uploads committed target translations into Crowdin." >&2 + echo "Re-run it with confirm_bootstrap=yes-bootstrap-current-target-translations when you really want the bootstrap path." >&2 + exit 1 + + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.base_branch }} + + - name: Bootstrap committed target translations into Crowdin + uses: crowdin/github-action@v2 + with: + config: crowdin.yml + skip_ref_checkout: true + upload_sources: true + upload_translations: true + download_translations: false + create_pull_request: false + env: + GITHUB_TOKEN: ${{ github.token }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Summarize bootstrap outcome + env: + BASE_BRANCH: ${{ inputs.base_branch }} + run: | + { + echo "## Crowdin bootstrap completed" + echo + echo "- Bootstrapped committed target-locale files from \`${BASE_BRANCH}\` into Crowdin." + echo "- This workflow is for one-time or exceptional seeding only." + echo "- The steady-state sync path remains \`crowdin-sync.yml\`, which uploads only \`zh-CN\` source assets on normal push-triggered runs and returns translations through \`l10n_${BASE_BRANCH}\` pull requests." + } >> "$GITHUB_STEP_SUMMARY"