-
-
Notifications
You must be signed in to change notification settings - Fork 15
70 lines (58 loc) · 1.77 KB
/
crowdin.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
name: Crowdin synchronization
on:
workflow_dispatch:
schedule:
- cron: '2 */12 * * *'
push:
paths: [
'swift-paperless/Localization/*.xcstrings',
]
branches: [ main ]
permissions:
contents: write
pull-requests: write
jobs:
synchronize-with-crowdin:
name: Crowdin Sync
runs-on: ubuntu-latest
env:
PRE_COMMIT_HOME: '/tmp/pre-commit'
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pre-commit
run: |
pip install pre-commit
- uses: actions/cache@v4
with:
path: |
${{ env.PRE_COMMIT_HOME }}
key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Checkout
uses: actions/checkout@v4
- name: Crowdin push
uses: crowdin/github-action@v2
with:
command: push
- name: Crowdin pull
uses: crowdin/github-action@v2
with:
command: pull
- name: Fix generated files
run: |
sudo chown $(whoami):$(whoami) swift-paperless/Localization/*.xcstrings
pre-commit run end-of-file-fixer --files swift-paperless/Localization/*.xcstrings || true
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_TOKEN }}
title: 'chore: Update localization'
commit-message: 'chore: Update localization'
branch: l18n_update
delete-branch: true
body: "Automated update of localizations from Crowdin"
base: main
add-paths: swift-paperless/Localization