Skip to content

Commit e71bc77

Browse files
author
Ilya Egorov
committed
Update sync wf
1 parent b23d0a0 commit e71bc77

File tree

3 files changed

+20
-31
lines changed

3 files changed

+20
-31
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@ on:
44
push:
55
branches:
66
- release-candidate-main
7+
- l10n-release-candidate-ru
78
- release-candidate-ru
9+
- l10n-release-candidate-en
810
- release-candidate-en
11+
- l10n-release-candidate-ja
912
- release-candidate-ja
13+
- l10n-release-candidate-ko
1014
- release-candidate-ko
15+
- l10n-release-candidate-zh-cn
1116
- release-candidate-zh-cn
1217

1318
jobs:
1419
build:
1520
runs-on: ubuntu-latest
16-
environment: "${{ startsWith(github.ref, 'refs/heads/release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/td-') && 'testing' || 'unknown' }}"
21+
environment: "${{ startsWith(github.ref, 'refs/heads/release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/l10n-release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/td-') && 'testing' || 'unknown' }}"
1722
env:
18-
JOB_ENV: "${{ startsWith(github.ref, 'refs/heads/release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/td-') && 'testing' || 'unknown' }}"
19-
APP_ENV: "${{ startsWith(github.ref, 'refs/heads/release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/td-') && format('{0}{1}', 'testing-', github.ref_name) || 'unknown' }}"
23+
JOB_ENV: "${{ startsWith(github.ref, 'refs/heads/release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/l10n-release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/td-') && 'testing' || 'unknown' }}"
24+
APP_ENV: "${{ startsWith(github.ref, 'refs/heads/release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/l10n-release-candidate-') && 'staging' || startsWith(github.ref, 'refs/heads/td-') && format('{0}{1}', 'testing-', github.ref_name) || 'unknown' }}"
2025
APP_DOMAIN: "${{ format('{0}-{1}', github.ref_name, vars.APP_DOMAIN) }}"
2126
concurrency:
2227
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/sync-crowdin-to-rc.yml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
lang: [ru, ko, ja, zh-CN]
15+
lang: [ru]
1616

1717
steps:
1818
- name: Checkout code
@@ -28,37 +28,21 @@ jobs:
2828
- name: Install Crowdin CLI
2929
run: npm install -g @crowdin/cli
3030

31-
- name: Download completed translations
32-
env:
33-
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
34-
run: |
35-
crowdin download --export-only-approved --branch main --config crowdin-oss.yml --language=${{ matrix.lang }}
36-
3731
- name: Configure Git
3832
run: |
3933
git config user.name "github-actions[bot]"
4034
git config user.email "github-actions[bot]@users.noreply.github.com"
4135
42-
- name: Create translations branch
43-
run: |
44-
git checkout -B l10n-release-candidate-${{ matrix.lang }}
45-
4636
- name: Commit and push translations
37+
env:
38+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
39+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
4740
run: |
41+
git stash --include-untracked
42+
git checkout -b l10n-release-candidate-${{ matrix.lang }}
43+
git pull --rebase origin l10n-release-candidate-${{ matrix.lang }} || true
44+
crowdin download --export-only-approved --branch main --config crowdin-oss.yml --language=${{ matrix.lang }}
4845
git add i18n/${{ matrix.lang }}
49-
git diff --quiet --cached || ( \
50-
git commit -m "chore: update ${{ matrix.lang }} translations" && \
51-
git push -u origin l10n-release-candidate-${{ matrix.lang }} \
52-
)
53-
54-
- name: Create Pull Request
55-
uses: peter-evans/create-pull-request@v5
56-
with:
57-
token: ${{ secrets.GH_TOKEN }}
58-
commit-message: "chore: update ${{ matrix.lang }} translations"
59-
branch: l10n-release-candidate-${{ matrix.lang }}
60-
base: release-candidate-${{ matrix.lang }}
61-
title: "Update ${{ matrix.lang }} translations — release-candidate-${{ matrix.lang }}"
62-
body: |
63-
This automated PR updates only the fully translated `${{ matrix.lang }}` files.
64-
labels: translation, automated
46+
git commit -m "chore: update ${{ matrix.lang }} translations"
47+
git push -u origin l10n-release-candidate-${{ matrix.lang }} || true
48+
gh pr create -B release-candidate-${{ matrix.lang }} -H l10n-release-candidate-${{ matrix.lang }} --title "chore: update `${{ matrix.lang }}` translations" --body 'This automated PR updates only the fully translated `${{ matrix.lang }}` files.' || true

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const getEnvLangConfig = () => {
2525
path: "zh-CN",
2626
},
2727
ru: {
28-
label: "Русский",
28+
label: 'Русский',
2929
path: "ru",
3030
},
3131
},

0 commit comments

Comments
 (0)