Locales #12
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: Locales | |
on: | |
workflow_run: | |
workflows: [Lint] | |
types: [completed] | |
branches: [main] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
locales: | |
name: Locales Sync | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
id: checkout-code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install dependencies | |
run: | | |
yarn | |
- name: Run generating script | |
run: | | |
yarn locales:generate | |
env: | |
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} | |
- name: Configure git | |
run: | | |
git config --global user.name "turtlesocks-bot" | |
git config --global user.email "[email protected]" | |
- name: Check for changes | |
run: | | |
if git diff --quiet; then | |
echo "changes_exist=false" >> $GITHUB_ENV | |
else | |
echo "changes_exist=true" >> $GITHUB_ENV | |
fi | |
- name: Commit and push changes | |
if: ${{ env.changes_exist == 'true' }} | |
run: | | |
git add --all | |
git commit --message "chore: sync locales" | |
git push | |
git checkout develop | |
git merge main | |
git push origin develop |