-
Notifications
You must be signed in to change notification settings - Fork 839
49 lines (43 loc) · 1.47 KB
/
i18n-update-translation-files-from-locize.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
# Runs via manual trigger and on a cron schedule
name: i18n Update Translation Files from Locize
on:
workflow_dispatch:
schedule:
- cron: "0 */3 * * *" # Every 3 hours
jobs:
fetch-and-process-translation-files:
runs-on: ubuntu-latest
name: Fetch and process translation files
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Fetch and process translations from Locize
run: node json-tasks.js fetch-and-process-translation-files
working-directory: packages/i18n
env:
LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }}
LOCIZE_NAMESPACE: ${{ vars.LOCIZE_NAMESPACE }}
LOCIZE_PROJECT_ID: ${{ vars.LOCIZE_PROJECT_ID }}
- name: Check for changes
id: git-check
run: |
git add packages/i18n/src/locales
git status
if git diff --staged --quiet; then
echo "No changes detected."
else
echo "Changes detected."
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git commit -m "fetch-and-process-translation-files updates"
git push origin master:bot/i18n-updates --force