chore: add workflow to organize translations and commit changes #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |