-
-
Notifications
You must be signed in to change notification settings - Fork 31
59 lines (57 loc) · 1.93 KB
/
update-translations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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 "actions@github.com"
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 <147535828+ChameleonHelper@users.noreply.github.com>"
committer: "Chameleon Helper <147535828+ChameleonHelper@users.noreply.github.com>"
delete-branch: true