forked from bigtreetech/PandaTouch
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.23 KB
/
check_translation.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
name: Check the translation for errors
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'Translation/**/*.yml' # Include yml files in Translation and all its subfolders
jobs:
check-trans:
runs-on: ubuntu-latest
steps:
- name: Clone main git repo
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
path: MAIN_REPO
- name: Checkout pull request
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
path: PR_REPO # Files will be checked out to the 'PR-REPO' directory
# Install Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install dependencies
run: pip install ruamel.yaml
# Step to run the Python script and capture errors
- name: Check YML
run: |
set -o pipefail # Ensure the script fails if Python script fails
python MAIN_REPO/WorkflowScripts/sync_translations.py 2>&1 | tee python_output.log || (cat python_output.log && exit 1)