Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #41

Merged
merged 18 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
33d5999
Sync branch [skip ci]
pirate-bot Jun 6, 2023
797c0de
Sync branch [skip ci]
pirate-bot Jun 6, 2023
eb3bbc9
feat: add translation job Codeinwp/themeisle#1545
preda-bogdan Jul 20, 2023
bc58199
chore: added missing folder
preda-bogdan Jul 20, 2023
fb6a31b
chore: added missing folder
preda-bogdan Jul 20, 2023
01cebf8
Merge pull request #30 from Codeinwp/feat/translation_job
preda-bogdan Jul 21, 2023
a826055
chore: update wp tested version
irinelenache Nov 13, 2023
00a1892
feat: add nps form
HardeepAsrani Jan 24, 2024
f2e8100
Merge pull request #38 from Codeinwp/feat/issue-37
HardeepAsrani Feb 6, 2024
80d501e
Merge pull request #36 from Codeinwp/update-wp-tested-version
HardeepAsrani Feb 6, 2024
d0456d0
chore(deps): bump codeinwp/themeisle-sdk from 3.3.0 to 3.3.13
dependabot[bot] Feb 6, 2024
ad81a49
chore(deps-dev): bump automattic/vipwpcs from 2.3.3 to 2.3.4
dependabot[bot] Feb 6, 2024
c8a3745
chore(deps-dev): bump yoast/phpunit-polyfills from 1.0.4 to 2.0.0
dependabot[bot] Feb 6, 2024
954d237
chore(deps-dev): bump squizlabs/php_codesniffer from 3.7.1 to 3.8.1
dependabot[bot] Feb 6, 2024
6b729b7
Merge pull request #40 from Codeinwp/dependabot/composer/development/…
HardeepAsrani Feb 6, 2024
2d4fa04
Merge pull request #39 from Codeinwp/dependabot/composer/development/…
HardeepAsrani Feb 6, 2024
2532038
Merge pull request #34 from Codeinwp/dependabot/composer/development/…
HardeepAsrani Feb 6, 2024
de55791
Merge pull request #28 from Codeinwp/dependabot/composer/development/…
HardeepAsrani Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/diff-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Translations Diff

on:
pull_request_review:
pull_request:
types: [opened, edited, synchronize, ready_for_review]
branches:
- 'development'

jobs:
translation:
runs-on: ubuntu-latest
steps:
- name: Checkout Ref Base
uses: actions/checkout@v2
with:
path: riverbank-head
- name: Setup node 14
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: FRESH Makepot BASE
run: |
cd riverbank-head
ls languages/
composer install --no-dev --prefer-dist --no-progress --no-suggest
yarn install --frozen-lockfile
yarn run build
ls languages/
- name: Checkout Ref Head
uses: actions/checkout@v2
with:
ref: development
path: riverbank-base
- name: FRESH Makepot HEAD
run: |
cd riverbank-base
ls languages/
composer install --no-dev --prefer-dist --no-progress --no-suggest
yarn install --frozen-lockfile
yarn run build
ls languages/
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find_coomment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'pirate-bot'
body-includes: PR has POT difference
- name: Install PODiff
run: |
curl -o podiff.gz ftp://download.gnu.org.ua/pub/releases/podiff/podiff-1.3.tar.gz
tar -xf podiff.gz
cd podiff-1.3
make
mkdir -p $GITHUB_WORKSPACE/bin
mv ./podiff $GITHUB_WORKSPACE/bin
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
cd ..
- name: Run Podiff
id: translation_status
run: |
${GITHUB_WORKSPACE}/riverbank-head/bin/pot-diff.sh ./riverbank-base/languages/riverbank.pot ./riverbank-head/languages/riverbank.pot $PERCENT_TRESHOLD
- name: Step require review
if: steps.translation_status.outputs.has_pot_diff != 'success'
uses: Automattic/action-required-review@v3
with:
requirements: |
- name: Everything else
paths: unmatched
teams:
- "sbs"
status: Has translation changes, a review from SBS team is required
token: ${{ secrets.BOT_TOKEN }}
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 "has_pot_diff=failure" >> $GITHUB_OUTPUT
else
echo "has_pot_diff=success" >> $GITHUB_OUTPUT
echo "No differences found"
fi
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"wp-coding-standards/wpcs": "^2.3",
"squizlabs/php_codesniffer": "^3.7",
"phpcompatibility/php-compatibility": "^9.3",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^2.0"
},
"scripts": {
"format-fix-exit": "\"vendor/bin/phpcbf-fix-exit-0\" --standard=phpcs.xml --report-summary --report-source -s --runtime-set testVersion 7.0- ",
Expand Down
138 changes: 88 additions & 50 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading