Update translations #39
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@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 "[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: Create commit | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
if: steps.git-check.outputs.has_changes == 'true' | |
with: | |
commit_message: Update translations | |
branch: translations-branch | |
commit_options: '--no-verify' | |
status_options: '--untracked-files=no' | |
add_options: '-u' | |
push_options: '--force' | |
skip_dirty_check: true | |
skip_fetch: true | |
skip_checkout: true | |
disable_globbing: true | |
create_branch: true | |
- 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" |