Update translations #812
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: Update translations | |
on: | |
schedule: | |
- cron: "0 */12 * * *" | |
workflow_dispatch: | |
jobs: | |
update-translations: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
CROWDIN_API: ${{ secrets.CROWDIN_API }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.BOT_HELPER_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Run Python script | |
run: python update.py | |
working-directory: ./chameleonultragui/lib/l10n | |
- name: Check for changes | |
id: git-check | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "GitHub Actions" | |
git add chameleonultragui/lib/l10n/* | |
if [[ -z $(git status --untracked-files=no -s) ]]; then | |
echo "No changes" | |
else | |
echo "::set-output name=has_changes::true" | |
fi | |
- name: Remove old branch | |
if: steps.git-check.outputs.has_changes == 'true' | |
id: remove-branch | |
run: | | |
git remote set-url origin https://github.com/ChameleonHelper/ChameleonUltraGUI.git | |
git push origin :translations-branch || true | |
git remote set-url origin https://github.com/GameTec-live/ChameleonUltraGUI.git | |
- name: Create PR | |
if: steps.git-check.outputs.has_changes == 'true' | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.BOT_HELPER_TOKEN }} | |
base: main | |
branch: translations-branch | |
push-to-fork: ChameleonHelper/ChameleonUltraGUI | |
body: "Update translations" | |
commit-message: "feat: Update translations" | |
title: "feat: Update translations" | |
author: "Chameleon Helper <[email protected]>" | |
committer: "Chameleon Helper <[email protected]>" | |
delete-branch: true |