-
-
Notifications
You must be signed in to change notification settings - Fork 64
51 lines (49 loc) · 1.4 KB
/
locales.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
name: Locales
on:
workflow_call:
secrets:
OPENAI_API_KEY:
required: true
description: The API key for OpenAI
permissions: write-all
jobs:
sync:
if: ${{ github.ref_name == 'main' }}
runs-on: ubuntu-latest
outputs:
made_commit: ${{ steps.commit.outputs.made_commit }}
env:
changes_exist: 'false'
steps:
- name: Checkout code
id: checkout-code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install dependencies
run: yarn
- name: Run generating script
run: yarn locales:generate
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Configure git
run: |
git config --global user.name "turtlesocks-bot"
git config --global user.email "[email protected]"
- name: Check for changes
run: |
if git diff --quiet; then
echo "changes_exist=false" >> $GITHUB_ENV
else
echo "changes_exist=true" >> $GITHUB_ENV
fi
- name: Commit and push changes
id: commit
if: ${{ env.changes_exist == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add --all
git commit --message "chore: sync locales [skip ci]"
git push
echo "made_commit=true" >> $GITHUB_OUTPUT