forked from medusajs/medusa
-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (36 loc) · 1.24 KB
/
admin-i18n-validation.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
name: i18n Validation
on:
pull_request:
paths:
- packages/admin/dashboard/src/i18n/translations/**
jobs:
i18n-validation-admin-dashboard:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
working-directory: packages/admin/dashboard
run: yarn install
- name: Validate i18n translations
working-directory: packages/admin/dashboard
run: |
git diff --name-only --diff-filter=A origin/develop HEAD -- src/i18n/translations > i18n_added_files.txt
cat i18n_added_files.txt
while read -r file; do
# Get the base name of the file
filename=$(basename "$file")
# Skip those items
if [ "$filename" = "\$schema.json" ] || [ "$filename" = "index.ts" ] || [ -d "$file" ]; then
continue
fi
# Run validation on the file
yarn i18n:validate "$filename"
done < i18n_added_files.txt