Skip to content

chore: add workflow to organize translations and commit changes #1

chore: add workflow to organize translations and commit changes

chore: add workflow to organize translations and commit changes #1

name: Organize JSON Keys on Translations and Commit Changes
on:
push:
paths:
- 'app/i18n/locales/**.json'
jobs:
organize-and-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Run script to organize JSON keys
run: node scripts/organize-translations.js
- name: Check for changes
id: git-check
run: |
git diff
if git diff --quiet; then
echo "::set-output name=changed::false"
else
echo "::set-output name=changed::true"
fi
- name: Commit and push if changes
if: steps.git-check.outputs.changed == 'true'
uses: EndBug/add-and-commit@v9
with:
message: 'Your commit message'