From 91659ad364652898796835ac6281ecead681189f Mon Sep 17 00:00:00 2001 From: Furior <68264134+Furrior@users.noreply.github.com> Date: Sun, 22 Oct 2023 02:46:01 +0700 Subject: [PATCH] Prayge5 (#530) --- .github/workflows/translate_branch_update.yml | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/.github/workflows/translate_branch_update.yml b/.github/workflows/translate_branch_update.yml index fb85099bcc01..26b025205bbf 100644 --- a/.github/workflows/translate_branch_update.yml +++ b/.github/workflows/translate_branch_update.yml @@ -1,4 +1,4 @@ -name: Update translate branch +name: Update translation branch on: workflow_dispatch: @@ -6,31 +6,43 @@ on: branches: ['master'] jobs: - add_translation: + update_translation: runs-on: ubuntu-latest permissions: contents: write pull-requests: write + name: 'Update old translation' steps: - - name: 'Update Branch' - uses: actions/checkout@v4 - - - name: Create temporary branch - run: | - git branch -f translate_tmp - git checkout translate_tmp - git reset --hard origin/master - - - name: Apply existing translation - run: | - git fetch origin translate - git checkout origin/translate -- ./tools/translator/ss220replace.json - ./tools/translator/ss220_replacer_linux --prefix=ss220 --root=./../../ --location=./ - - - name: 'Push Translation' - run: | - git config --local user.email "action@github.com" - git config --local user.name "SS220Manager" - git commit -m "Generate translation file" - git push -u -f origin translate + - name: 'Update Branch' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Installing Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Installing deps + run: | + python -m pip install --upgrade pip + pip install -r ./tools/translator/requirements.txt + + - name: Create temporary branch + run: | + git checkout -b translate_tmp + git reset --hard origin/master + + - name: Apply existing translation + run: | + git fetch origin translate + git checkout origin/translate -- ./tools/translator/ss220replace.json + ./tools/translator/ss220_replacer_linux --prefix=ss220 --root=./../../ --location=./ + + - name: 'Push Translation' + run: | + git config --local user.email "action@github.com" + git config --local user.name "SS220Manager" + git commit -m "Generate translation file" + git push -f origin translate_tmp:translate