Skip to content

Commit c51439b

Browse files
committed
Add workflow for generate-translators
1 parent 07f8d11 commit c51439b

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Update crowdin-translators.json"
2+
3+
on:
4+
workflow_dispatch:
5+
delete:
6+
branches:
7+
- l10n/master
8+
9+
jobs:
10+
generate_translators:
11+
# if: github.event.repository.fork == false
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
ref: master
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: latest
23+
cache: 'npm'
24+
- name: Install dependencies
25+
working-directory: ./utils/localization/generate-translators
26+
run: npm clean-install
27+
- name: Generate translators
28+
working-directory: ./utils/localization/generate-translators
29+
env:
30+
CROWDIN_TOKEN: "${{ secrets.CROWDIN_TOKEN }}"
31+
CROWDIN_ORGANIZATION: "multitheftauto"
32+
CROWDIN_PROJECT_ID: "13" # Multi Theft Auto
33+
CROWDIN_IGNORE_USER_ID: "2" # multitheftautoqa
34+
run: npm run ci
35+
- name: Commit changes
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
git config --global user.name 'github-actions[bot]'
40+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
41+
42+
git add ./utils/localization/generate-translators/crowdin-translators.json
43+
44+
if ! git diff-index --quiet HEAD; then
45+
git commit -m "Update crowdin-translators.json"
46+
git push
47+
fi

0 commit comments

Comments
 (0)