check if po files changed #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: compile-catalogs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
compile-catalogs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check diff | |
run: | | |
REGEXP="^libresvip/.*\.po$" | |
PO_CHANGED_COUNT=$(git show --name-only | grep "$REGEXP" | wc -l) | |
PO_CHANGED=$([[ PO_CHANGED_COUNT -gt 0 ]] && echo "true" || echo "false") | |
echo "::set-output name=po_changed::$PO_CHANGED" | |
- 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 |