-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (38 loc) · 1.25 KB
/
compile_catalog.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
name: compile-catalogs
on:
push:
branches:
- main
jobs:
compile-catalogs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check diff
id: check-diff
run: |
git fetch origin main
git merge-base origin/main HEAD
REGEXP="^libresvip/.*\.po$"
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }})
echo "Changed files: $CHANGED_FILES"
PO_CHANGED_COUNT=$(echo $CHANGED_FILES | grep "$REGEXP" | wc -l)
PO_CHANGED=$([[ PO_CHANGED_COUNT -gt 0 ]] && echo "true" || echo "false")
echo "po_changed=$PO_CHANGED" >> $GITHUB_OUTPUT
- name: Set up Python
if: ${{ steps.check-diff.outputs.po_changed == 'true' }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Compile catalogs
if: ${{ steps.check-diff.outputs.po_changed == 'true' }}
run: |
pip install babel setuptools
cd scripts
python batch_compile_catalog.py
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: compile catalogs