diff --git a/.github/workflows/diff-translations.yml b/.github/workflows/diff-translations.yml index ed67747..147f631 100644 --- a/.github/workflows/diff-translations.yml +++ b/.github/workflows/diff-translations.yml @@ -61,7 +61,7 @@ jobs: - name: Run Podiff id: translation_status run: | - ${GITHUB_WORKSPACE}/neve-head/bin/pot-diff.sh ./neve-base/languages/neve.pot ./neve-head/languages/neve.pot $PERCENT_TRESHOLD + ${GITHUB_WORKSPACE}/neve-fse-head/bin/pot-diff.sh ./neve-base/languages/neve.pot ./neve-head/languages/neve.pot $PERCENT_TRESHOLD - name: Step require review if: steps.translation_status.outputs.has_pot_diff != 'success' uses: Automattic/action-required-review@v2 diff --git a/bin/pot-diff.sh b/bin/pot-diff.sh new file mode 100755 index 0000000..67329b4 --- /dev/null +++ b/bin/pot-diff.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Set Arguments +file1="$1" +file2="$2" + +## Striping headers for file1 and file2. + +sed '/^"/d' $file1 > $file1.edited +mv $file1.edited $file1 +sed '/^"/d' ${file2} > ${file2}.edited +mv ${file2}.edited ${file2} + +if [[ $(podiff $file1 $file2) ]]; then + podiff $file1 $file2 + echo "::set-output name=has_pot_diff::failure" +else + echo "::set-output name=has_pot_diff::success" + echo "No differences found" +fi