-
Notifications
You must be signed in to change notification settings - Fork 27
72 lines (65 loc) · 2.37 KB
/
i18n.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
60
61
62
63
64
65
66
67
68
69
70
71
72
name: i18n
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- "apps/*/.env"
jobs:
create:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@master
name: Check out code
- name: Get changed apps list and Update translation.json
run: |
echo "Get list"
changefile=$(curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{github.token}}" \
https://api.github.com/repos/Websoft9/docker-library/compare/${{github.event.before}}...${{github.event.after}} | jq '.files[].filename' | sed 's/\"//g')
declare -a appnames
for name in ${changefile};do
echo ${name}
app=$(echo ${name} | cut -d "/" -f 2)
file=$(echo ${name} | cut -d "/" -f 3)
if [[ ${file} == ".env" ]];then
if [[ ! " ${appnames[@]} " =~ " ${app} " ]]; then
appnames+=(${app})
fi
else
echo "affect nothing";
fi
done
echo "start to update translation.json"
cd i18n
python3 create.py appnames
- name: push i18n
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: push i18n
push_options: --force
pr:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Checkout websoft9
uses: actions/checkout@v2
with:
repository: Websoft9/plugin-appstore
ref: main
- name: update languages files
run: |
wget https://raw.githubusercontent.com/Websoft9/docker-library/main/i18n/translation.json
wget ttps://raw.githubusercontent.com/Websoft9/docker-library/main/i18n/pr.py
python3 pr.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.ZJ_ADMIN_TOKEN }}
branch: update-appstore-version-${{ github.run_number }}
delete-branch: true
commit-message: App Store conbine translation.json
title: "App Store conbine translation.json: ${{ steps.update_data.outputs.PLUGIN_VERSION }}"
body: "App Store conbine translation.json"