-
-
Notifications
You must be signed in to change notification settings - Fork 35
33 lines (31 loc) · 1.07 KB
/
add-crowdin-keys.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
name: Add Crowdin Translation Strings
on:
pull_request:
branches: [ main ]
types:
- closed
jobs:
check_changes:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
CROWDIN_API: ${{ secrets.CROWDIN_API }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Watching for changes in app_en.arb and run Python script
run: |
CHANGED_FILES=$(git diff --name-only -r HEAD^1 HEAD)
# Check if the specific file is in the changed files list
if echo "$CHANGED_FILES" | grep -q 'app_en.arb'; then
FILE=$(git diff HEAD^1:chameleonultragui/lib/l10n/app_en.arb HEAD:chameleonultragui/lib/l10n/app_en.arb --no-ext-diff --unified=0 -a --no-prefix | egrep "^\+")
python chameleonultragui/lib/l10n/updateCrowdin.py "$FILE"
else
echo "The file 'app_en.arb' has not changed."
fi