forked from WJDDesigns/Ultra-Card
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.28 KB
/
validate-translations.yml
File metadata and controls
47 lines (39 loc) · 1.28 KB
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: Validate Translations
on:
pull_request:
paths:
- 'src/translations/**'
push:
paths:
- 'src/translations/**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Validate translation files
run: npm run validate:translations
- name: Check JSON syntax
run: |
for file in src/translations/*.json; do
echo "Validating $file"
cat "$file" | jq . > /dev/null || exit 1
done
- name: Comment on PR
if: github.event_name == 'pull_request' && failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ Translation validation failed. Please check the JSON syntax and ensure all required keys are present. See [Translation Guidelines](https://github.com/WJDDesigns/Ultra-Card/blob/main/CONTRIBUTING_TRANSLATIONS.md) for help.'
})