-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (64 loc) · 1.77 KB
/
vpn.yaml
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
name: VPN Client
on:
push:
branches:
- main
paths:
- '.github/workflows/vpn.yaml'
- '.github/requirements.txt'
- 'l10n/xliff_l10n.py'
- 'l10n/exceptions/vpn.json'
pull_request:
branches:
- main
paths:
- '.github/workflows/vpn.yaml'
- '.github/requirements.txt'
- 'l10n/xliff_l10n.py'
- 'l10n/exceptions/vpn.json'
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
path: "scripts_repo"
- name: Clone target repository
uses: actions/checkout@v4
with:
repository: "mozilla-l10n/mozilla-vpn-client-l10n"
path: "target_repo"
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
pip install -r scripts_repo/.github/requirements.txt
- name: Lint localization
run: >
python scripts_repo/l10n/xliff_l10n.py
--l10n target_repo/
--dest errors.txt
--exceptions scripts_repo/l10n/exceptions/vpn.json
--no-failure
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: errors-list
path: errors.txt
if-no-files-found: ignore
- name: Fail on errors
run: |
if [ -f "errors.txt" ]; then
echo "### There are errors" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat errors.txt >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
exit 1
fi