forked from aave/interface
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.35 KB
/
crowdin-download.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
61
62
63
64
65
66
67
68
69
70
71
72
name: Download crowdin files
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
download-from-crowdin:
name: Download sources from Crowdin
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
token: ${{ secrets.BOT_TOKEN }}
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # v3.4.1
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: crowdin action
uses: crowdin/github-action@97aa99cbebfe99b964e3521e6421c1518146d4b9 # v1.4.12
with:
project_id: 502668
token: ${{ secrets.CROWDIN_TOKEN }}
upload_translations: false
download_translations: true
create_pull_request: false
push_translations: false
config: 'crowdin.yml'
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
- name: check diff
run: |
if [[ -z $(git status -s) ]]
then
echo "tree is clean"
else
yarn --frozen-lockfile
yarn i18n:compile
git add .
git config --global user.name 'Crowdin bot'
git config --global user.email '[email protected]'
git commit -am "chore(i18n): synchronize translations from crowdin [skip cypress]"
git push
exit
fi
NotifyFailure:
needs: [download-from-crowdin]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- id: text
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "out=${{ github.workflow }}:\t<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>\\n $(gh api /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq -c '.jobs | .[] | select( .conclusion | contains("failure"))' | jq -r '"- <\(.html_url)|\(.name)>\\n"' | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Webhook
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL }}
body: '{"text": "${{ steps.text.outputs.out }}"}'