-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.51 KB
/
update-locales.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
45
46
47
48
49
50
51
52
53
54
55
name: Update locales
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 1-5'
permissions:
contents: write
jobs:
update-locales:
name: 'Update locales'
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: 'Checkout code'
uses: actions/[email protected]
with:
token: ${{ secrets.PREREVIEW_BOT_TOKEN }}
sparse-checkout: |
locales/
crowdin.yml
sparse-checkout-cone-mode: false
- name: 'Download translations from Crowdin'
uses: crowdin/[email protected]
with:
upload_sources: false
upload_translations: false
download_sources: false
download_translations: true
export_only_approved: true
push_translations: false
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
- name: 'Restore file ownership'
run: sudo chown -R $USER:$USER locales
- name: 'Remove empty files'
run: grep --files-with-matches --recursive --null "^{}" locales | xargs --no-run-if-empty -0 rm
- name: 'Remove empty locales'
run: find locales -empty -type d -delete
- name: 'Commit changes'
uses: stefanzweifel/[email protected]
if: ${{ !env.ACT }}
with:
commit_message: 'Update locales'
commit_user_name: 'prereview-bot'
commit_user_email: '[email protected]'
commit_author: 'prereview-bot <[email protected]>'