-
Notifications
You must be signed in to change notification settings - Fork 328
53 lines (50 loc) · 1.39 KB
/
sync-locale.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
name: sync-locale
on:
push:
branches:
- sync-locale
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
locale:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Format output
run: node ./locales.js
- name: Checkout dev branch
uses: actions/checkout@v3
with:
ref: 'dev'
path: '_dev_'
- name: Copy new locale
run: |
rm -rf ./_dev_/public/_locales
cp -r ./output ./_dev_/public/_locales
- name: Deploy to dev-locale
run: |
cd ./_dev_
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
GIT_STATUS=$(git status --porcelain)
if [[ $GIT_STATUS != "" ]]; then
git add --all .
git commit -m '[skip ci] sync locale' --quiet --no-verify
else
echo "no content, skip commit"
fi
git push --force origin dev:dev-locale
- name: Create PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm i axios
node ./create-pr.js