From 602c8f5ca6ad14c44056f1b4dbeea34d70fd2375 Mon Sep 17 00:00:00 2001 From: SoulMelody Date: Mon, 1 Jul 2024 06:54:38 +0800 Subject: [PATCH] check if po files changed --- .github/workflows/compile_catalog.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile_catalog.yml b/.github/workflows/compile_catalog.yml index a672f8426..467ec3fa7 100644 --- a/.github/workflows/compile_catalog.yml +++ b/.github/workflows/compile_catalog.yml @@ -11,16 +11,25 @@ jobs: 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: Install babel - run: pip install babel setuptools - - name: Compile catalogs + if: ${{ steps.check-diff.outputs.po_changed == 'true' }} run: | + pip install babel setuptools cd scripts python batch_compile_catalog.py