Skip to content

feat(ui): refreshing the main dashboard (#4959) #16

feat(ui): refreshing the main dashboard (#4959)

feat(ui): refreshing the main dashboard (#4959) #16

name: Generate Translations
on:
push:
branches:
- develop
paths:
- 'ui/src/translations/en.json'
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
jobs:
generate-translations:
name: Generate Translations and Create PR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 10 # Ensures that at least 10 commits are fetched for comparison
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install gitpython openai
- name: Generate translations
run: python ui/src/translations/generate_translations.py
- name: Commit, push changes, and create PR
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
BRANCH_NAME="translations/update-translations-$(date +%s)"
git checkout -b $BRANCH_NAME
git add ui/src/translations/*.json
git commit -m "Auto-generate translations from en.json"
git push --set-upstream origin $BRANCH_NAME
gh pr create --title "Auto-generate translations from en.json" --body "This PR was created automatically by a GitHub Action." --base develop --head $BRANCH_NAME --assignee anna-geller --reviewer anna-geller