Skip to content

Commit 171b4de

Browse files
release: version 1.0.3
### Improvements - **WordPress compatibility check**: Tested with the latest WordPress version for compatibility.
2 parents 2823734 + b21e98f commit 171b4de

File tree

7 files changed

+236
-56
lines changed

7 files changed

+236
-56
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Translations Diff
2+
3+
on:
4+
pull_request_review:
5+
pull_request:
6+
types: [opened, edited, synchronize, ready_for_review]
7+
branches:
8+
- 'development'
9+
10+
jobs:
11+
translation:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Ref Base
15+
uses: actions/checkout@v2
16+
with:
17+
path: jaxon-head
18+
- name: Setup node 14
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14.x
22+
- name: FRESH Makepot BASE
23+
run: |
24+
cd jaxon-head
25+
ls languages/
26+
composer install --no-dev --prefer-dist --no-progress --no-suggest
27+
yarn install --frozen-lockfile
28+
yarn run build
29+
ls languages/
30+
- name: Checkout Ref Head
31+
uses: actions/checkout@v2
32+
with:
33+
ref: development
34+
path: jaxon-base
35+
- name: FRESH Makepot HEAD
36+
run: |
37+
cd jaxon-base
38+
ls languages/
39+
composer install --no-dev --prefer-dist --no-progress --no-suggest
40+
yarn install --frozen-lockfile
41+
yarn run build
42+
ls languages/
43+
- name: Find Comment
44+
uses: peter-evans/find-comment@v2
45+
id: find_coomment
46+
with:
47+
issue-number: ${{ github.event.pull_request.number }}
48+
comment-author: 'pirate-bot'
49+
body-includes: PR has POT difference
50+
- name: Install PODiff
51+
run: |
52+
curl -o podiff.gz ftp://download.gnu.org.ua/pub/releases/podiff/podiff-1.3.tar.gz
53+
tar -xf podiff.gz
54+
cd podiff-1.3
55+
make
56+
mkdir -p $GITHUB_WORKSPACE/bin
57+
mv ./podiff $GITHUB_WORKSPACE/bin
58+
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
59+
cd ..
60+
- name: Run Podiff
61+
id: translation_status
62+
run: |
63+
${GITHUB_WORKSPACE}/jaxon-head/bin/pot-diff.sh ./jaxon-base/languages/jaxon.pot ./jaxon-head/languages/jaxon.pot $PERCENT_TRESHOLD
64+
- name: Step require review
65+
if: steps.translation_status.outputs.has_pot_diff != 'success'
66+
uses: Automattic/action-required-review@v3
67+
with:
68+
requirements: |
69+
- name: Everything else
70+
paths: unmatched
71+
teams:
72+
- "sbs"
73+
status: Has translation changes, a review from SBS team is required
74+
token: ${{ secrets.BOT_TOKEN }}

bin/pot-diff.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Set Arguments
3+
file1="$1"
4+
file2="$2"
5+
6+
## Striping headers for file1 and file2.
7+
8+
sed '/^"/d' $file1 > $file1.edited
9+
mv $file1.edited $file1
10+
sed '/^"/d' ${file2} > ${file2}.edited
11+
mv ${file2}.edited ${file2}
12+
13+
if [[ $(podiff $file1 $file2) ]]; then
14+
podiff $file1 $file2
15+
echo "has_pot_diff=failure" >> $GITHUB_OUTPUT
16+
else
17+
echo "has_pot_diff=success" >> $GITHUB_OUTPUT
18+
echo "No differences found"
19+
fi

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"wp-coding-standards/wpcs": "^2.3",
4545
"squizlabs/php_codesniffer": "^3.7",
4646
"phpcompatibility/php-compatibility": "^9.3",
47-
"yoast/phpunit-polyfills": "^1.0"
47+
"yoast/phpunit-polyfills": "^2.0"
4848
},
4949
"scripts": {
5050
"format-fix-exit": "\"vendor/bin/phpcbf-fix-exit-0\" --standard=phpcs.xml --report-summary --report-source -s --runtime-set testVersion 7.0- ",

composer.lock

Lines changed: 88 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)