-
-
Notifications
You must be signed in to change notification settings - Fork 251
44 lines (37 loc) · 1.75 KB
/
bot-crowdin-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: "[Bot] Crowdin translations update"
on: [workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
crowdin-sync:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Set current timestamp as env variable
run: echo "NOW=$(date +'%s')" >> $GITHUB_ENV
- name: Install dependencies
run: yarn install
- name: Run crowdin sync
run: |
git config --global user.name "trezor-ci"
git config --global user.email "${{ secrets.TREZOR_BOT_EMAIL }}"
git checkout -B ${{ env.BRANCH_NAME }}
yarn workspace @trezor/suite translations:download --token=${{ secrets.CROWDIN_PERSONAL_TOKEN }}
yarn workspace @trezor/suite translations:backport-en
yarn workspace @trezor/suite translations:format
yarn workspace @trezor/suite translations:extract
cat packages/suite-data/files/translations/master.json
yarn workspace @trezor/suite translations:upload --token=${{ secrets.CROWDIN_PERSONAL_TOKEN }}
git add . && git commit -m "chore: crowdin translation update" && git push origin ${{ env.BRANCH_NAME }} -f
gh config set prompt disabled
gh pr create --repo trezor/trezor-suite --title "Crowdin translations update" --body "Automatically generated PR for updating crowdin translations." --base develop --label translations
env:
GITHUB_TOKEN: ${{ secrets.TREZOR_BOT_TOKEN }}
BRANCH_NAME: trezor-ci/crowdin-sync-${{ env.NOW }}