-
Notifications
You must be signed in to change notification settings - Fork 13
50 lines (39 loc) · 1.36 KB
/
update-pot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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