-
-
Notifications
You must be signed in to change notification settings - Fork 141
60 lines (57 loc) · 1.81 KB
/
crowdin.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
56
57
58
59
60
name: Crowdin Action
on:
push:
branches: [ master ]
schedule:
- cron: '30 5,17 * * *'
workflow_dispatch:
jobs:
download-from-crowdin:
if: ${{ github.event_name != 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download from Crowdin
uses: crowdin/[email protected]
with:
upload_sources: false
download_translations: true
create_pull_request: false
push_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
- name: Commit changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [ -z "$(git status --porcelain)" ]; then
echo "Files have not changed"
else
echo "Files have changed"
git add .
git commit -m "[chore] Update translations" -a
git push origin master
fi
upload-to-crowdin:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Upload to Crowdin
uses: crowdin/[email protected]
if: ${{ github.event_name == 'push' }}
with:
upload_sources: true
download_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}