-
-
Notifications
You must be signed in to change notification settings - Fork 294
62 lines (54 loc) · 1.81 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
60
61
62
name: Update Translations
on:
push:
branches:
- 'main'
paths:
- 'crates/rnote-ui/po/LINGUAS'
- 'crates/rnote-ui/po/zh_Hans.po'
- 'crates/rnote-ui/po/zh_Hant.po'
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
i18n_zh_Hans2zh_Hant:
name: zh_Hans -> zh_Hant
runs-on: ubuntu-22.04
container: fedora:39
permissions:
contents: write # needed for pushing the changes
steps:
- name: Install dependencies
run: |
sudo dnf install --refresh -y git opencc-tools
- name: Setup repository
run: |
git clone -b ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} \
${{ github.server_url }}/${{ github.repository }} .
git config --global --add safe.directory "$(pwd)"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Update translations
run: |
bash ./build-aux/update-translations.sh
- name: Commit changes
id: commit-changes
run: |
echo -e "i18n: Update traditional Chinese translation\nreferenced issue: #220" \
| git commit -a -F - || export failure=$?
if [ -z $failure ]; then
echo "status=true" >> $GITHUB_OUTPUT
elif [ $failure = '1' ]; then
echo 'No commit made, skip push.'
echo "status=false" >> $GITHUB_OUTPUT
else
exit $failure
fi
- name: Push changes
if: ${{ steps.commit-changes.outputs.status == 'true' }}
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}