Skip to content

Commit

Permalink
chore: add diff script
Browse files Browse the repository at this point in the history
  • Loading branch information
preda-bogdan committed Jul 20, 2023
1 parent 0e88b11 commit 9431fc6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/diff-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions bin/pot-diff.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9431fc6

Please sign in to comment.