Skip to content

Commit b2d8faa

Browse files
committed
chore: add workflow to organize translations and commit changes
1 parent 9a54109 commit b2d8faa

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Organize JSON Keys on Translations and Commit Changes
2+
3+
on:
4+
push:
5+
paths:
6+
- 'app/i18n/locales/**.json'
7+
8+
jobs:
9+
organize-and-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18
20+
21+
- name: Run script to organize JSON keys
22+
run: node scripts/organize-translations.js
23+
24+
- name: Check for changes
25+
id: git-check
26+
run: |
27+
git diff
28+
if git diff --quiet; then
29+
echo "::set-output name=changed::false"
30+
else
31+
echo "::set-output name=changed::true"
32+
fi
33+
34+
- name: Commit and push if changes
35+
if: steps.git-check.outputs.changed == 'true'
36+
uses: EndBug/add-and-commit@v9
37+
with:
38+
message: 'Your commit message'

0 commit comments

Comments
 (0)