Update translations #3
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: | |
workflow_dispatch: | |
jobs: | |
update-translations: | |
runs-on: ubuntu-latest | |
env: | |
CROWDIN_API: ${{ secrets.CROWDIN_API }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- 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 "actions@github.com" | |
git config user.name "GitHub Actions" | |
git add chameleonultragui/lib/l10n/* | |
if git diff --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -m "Update translations" | |
git branch translations-branch | |
git push origin translations-branch --force | |
echo "::set-output name=has_changes::true" | |
fi | |
- name: Create PR | |
if: steps.git-check.outputs.has_changes == 'true' | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
base: main | |
branch: translations-branch | |
commit-message: "New translations fetched from Crowdin" | |
title: "feat: Update translations" |