Skip to content

Merge branch 'master' of https://github.com/harmonoid/translations #17

Merge branch 'master' of https://github.com/harmonoid/translations

Merge branch 'master' of https://github.com/harmonoid/translations #17

Workflow file for this run

name: Translate
on:
push:
branches: ["main", "master"]
paths:
- "localizations/en_US.json"
jobs:
translate:
if: github.event.pusher.name == 'alexmercerind' && github.event.pusher.email == 'saini123hitesh@gmail.com'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install llm-github-models CLI
run: |
pip install llm-github-models
- name: Configure llm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
llm keys set github --value "$GITHUB_TOKEN"
- name: Generate translations
run: |
python3 .github/scripts/translate.py
- name: Check for changes
id: check_changes
run: |
if git diff --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check_changes.outputs.has_changes == 'true'
id: create_pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: auto-translate localizations"
title: "Auto-Translate Localizations"
body: "This pull request contains automatically generated translations based on changes to `en_US.json`."
branch: auto-translate-${{ github.run_number }}
delete-branch: true