-
Notifications
You must be signed in to change notification settings - Fork 20
53 lines (45 loc) · 1.42 KB
/
auto-update-i18n.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: Auto Update i18n
on:
pull_request:
types: [opened, synchronize]
paths:
- 'src/frontend/src/lib/i18n/*'
- 'src/frontend/src/lib/types/i18n.d.ts'
jobs:
auto_update:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GIX_CREATE_PR_PAT }}
- name: Restore npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-i18n-npm-${{ hashFiles('package-lock.json', 'package.json') }}
restore-keys: |
${{ runner.os }}-i18n-npm-
- name: Prepare
uses: ./.github/actions/prepare
- name: Run i18n Script
run: npm run i18n
- name: Check for Changes
id: check_changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "changes_detected=true" >> $GITHUB_OUTPUT
else
echo "changes_detected=false" >> $GITHUB_OUTPUT
fi
- name: Commit i18n
if: steps.check_changes.outputs.changes_detected == 'true'
uses: EndBug/add-and-commit@v9
with:
add: '.'
default_author: github_actions
message: '🤖 Updated i18n files'
push: true
pull: 'default'