Skip to content

Commit 77859f8

Browse files
authored
Add localization update GitHub workflow (#1232)
1 parent 298efa8 commit 77859f8

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/loc-update.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Localization Update
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- 'loc/**'
9+
10+
jobs:
11+
update-localization:
12+
name: Update Localization Files
13+
runs-on: windows-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
ref: ${{ github.head_ref }}
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '18'
29+
cache: 'npm'
30+
31+
- name: Run Translations Import
32+
run: npm run translations-import
33+
34+
- name: Check for Changes
35+
id: git-check
36+
run: |
37+
git add -A
38+
git diff --staged --quiet && echo "changes=false" >> $GITHUB_OUTPUT || echo "changes=true" >> $GITHUB_OUTPUT
39+
40+
- name: Commit and Push Changes
41+
if: steps.git-check.outputs.changes == 'true'
42+
run: |
43+
git config --local user.name "github-actions[bot]"
44+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
45+
git commit -m "Automated localization update from CI" -a
46+
git push

0 commit comments

Comments
 (0)