Skip to content

Commit

Permalink
Merge branch 'color-migrate' of https://github.com/Codeinwp/raft into…
Browse files Browse the repository at this point in the history
… color-migrate
  • Loading branch information
HardeepAsrani committed Nov 16, 2023
2 parents 2bd6377 + 6eb324b commit 6ad45d8
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 27 deletions.
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: raft-head
- name: Setup node 14
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: FRESH Makepot BASE
run: |
cd raft-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: raft-base
- name: FRESH Makepot HEAD
run: |
cd raft-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}/raft-head/bin/pot-diff.sh ./raft-base/languages/raft.pot ./raft-head/languages/raft.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
54 changes: 30 additions & 24 deletions composer.lock

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

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
**Contributors:** [themeisle](https://profiles.wordpress.org/themeisle/)
**Tags:** block-patterns
**Requires at least:** 5.5
**Tested up to:** 6.0.1
**Tested up to:** 6.4
**Stable tag:** trunk
**Requires PHP:** 7.0
**License:** GPLv2 or later
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: themeisle
Tags: block-patterns
Requires at least: 5.5
Tested up to: 6.0.1
Tested up to: 6.4
Stable tag: trunk
Requires PHP: 7.0
License: GPLv2 or later
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1 class="has-text-align-center has-xxl-font-size">Our awesome blog</h1>

<!-- wp:group {"style":{"spacing":{"padding":{"top":"64px","bottom":"64px"}}},"layout":{"inherit":true}} -->
<div class="wp-block-group" style="padding-top:64px;padding-bottom:64px">
<!-- wp:query {"queryId":4,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"layout":{"inherit":true}} -->
<!-- wp:query {"queryId":4,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"inherit":true}} -->
<div class="wp-block-query">
<!-- wp:post-template -->
<!-- wp:group {"layout":{"inherit":true}} -->
Expand Down

0 comments on commit 6ad45d8

Please sign in to comment.