Localization Pull Local #2
This file contains hidden or 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: Localization Pull Local | |
on: | |
workflow_dispatch: | |
jobs: | |
sync_localizations: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm install | |
- name: Pull Google Sheets to JSON | |
run: node entrypoint.js pull '${{ secrets.GOOGLE_API_KEY_JSON }}' '${{ vars.SPREADSHEET_ID }}' './Acme.BookStore/src/Acme.BookStore.Domain.Shared/Localization' | |
- name: Add localization files | |
run: git add Acme.BookStore/src/Acme.BookStore.Domain.Shared/Localization/**/*.json | |
- name: Commit changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
if git diff-index --quiet HEAD; then | |
echo "No changes to commit" | |
else | |
git commit -m "Updated localizations from Google Sheets" | |
git push | |
fi |