add test Utils #232
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update POT file | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.php' | |
jobs: | |
update-pot: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP with tools | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.3' | |
tools: composer, wp-cli | |
- name: Install dependencies | |
run: | | |
wp package install wp-cli/i18n-command:2.2.8 | |
- name: Update POT file | |
run: wp i18n make-pot . languages/woocommerce-pos.pot --domain=woocommerce-pos --slug=woocommerce-pos --package-name="WooCommerce POS" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/wcpos/woocommerce-pos/issues\"}" | |
- name: Commit updated POT file | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'chore(l10n): update languages/woocommerce-pos.pot' | |
file_pattern: '*.pot' | |
push_options: '--dry-run' # We just want to check the diff first | |
- name: Check git diff | |
uses: technote-space/get-diff-action@v6 | |
with: | |
SET_ENV_NAME_COUNT: 'FILE_COUNT' | |
SET_ENV_NAME_LINES: 'LINE_COUNT' | |
PATTERNS: | | |
'*.pot' | |
- name: Commit updated POT file | |
if: env.FILE_COUNT != env.LINE_COUNT | |
uses: stefanzweifel/git-auto-commit-action@v4 | |