Skip to content

Composer(deps): Bump newfold-labs/wp-module-migration #813

Composer(deps): Bump newfold-labs/wp-module-migration

Composer(deps): Bump newfold-labs/wp-module-migration #813

Workflow file for this run

name: WP Internationalization
on:
push:
branches:
- '**'
pull_request:
types: [ opened, edited, synchronize, reopened, ready_for_review ]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
wp-i18n:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup workflow context
id: workflow
working-directory: ${{ runner.temp }}
env:
REPO: ${{ github.repository }}
run: |
mkdir dist
echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT
echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer vendor directory
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Log debug information
run: |
php --version
composer --version
node --version
npm --version
- name: Validate composer.json and composer.lock files
run: composer validate
- name: Install PHP Dependencies
run: composer install --no-progress --optimize-autoloader
- name: Add text domains
run: npx node-wp-i18n addtextdomain
- name: Generate POT file
run: vendor/bin/wp i18n make-pot . ./languages/${{ github.event.repository.name }}.pot --headers='{"Report-Msgid-Bugs-To":"https://github.com/${{ github.repository }}/issues","POT-Creation-Date":null}' --exclude=assets,storybook,tests
- name: Check if there are file changes
id: changes
uses: UnicornGlobal/has-changes-action@v1.0.12
- name: Commit web files
if: steps.changes.outputs.changed == 1
run: |
git config --local user.name "${{ github.event.head_commit.author.name }}"
git config --local user.email "${{ github.event.head_commit.author.email }}"
git remote -v
git add -A
git commit -m "WordPress I18N triggered by commit ${{ github.sha }}"
git status
- name: Push changes
if: steps.changes.outputs.changed == 1
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}