-
Notifications
You must be signed in to change notification settings - Fork 64
58 lines (49 loc) · 1.49 KB
/
update-translations.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
49
50
51
52
53
54
55
56
57
58
name: Update Translations
on:
pull_request:
branches:
- master
jobs:
update:
name: Update Translations
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Configure git user
run: |
git config --global user.name "godaddy-wordpress-bot"
git config --global user.email "[email protected]"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup WP-CLI
uses: godaddy-wordpress/setup-wp-cli@main
# Yarn is still required on this project, so we need to make sure it is
# installed globally.
- name: Install yarn
run: npm i -g yarn
- name: Install dependencies
run: |
composer install --no-dev --prefer-dist --optimize-autoloader
yarn install --immutable
- name: Create translations
run: |
yarn makepot
- name: Commit changes
shell: bash
run: |
if [ ! -z "$(git status languages/go.json --porcelain)" ]; then
git add languages/go.json
git add languages/go.pot
git commit -m "[BOT] Update language translations" --no-verify
git reset --hard
git push --quiet
else
echo "No language translations to update."
fi