check json format on pull request

This commit is contained in:
KOWX712
2025-01-19 22:18:39 +08:00
parent 1cb810405a
commit 2c5082acbc

31
.github/workflows/json-lint.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: pr_jsonlint
on:
pull_request:
paths:
- 'module/webui/locales/*.json'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install JSON linter
run: npm install -g jsonlint
- name: Lint JSON files
run: |
for file in $(find module/webui/locales -name "*.json"); do
echo "Checking $file"
if ! jsonlint "$file"; then
echo "Error in $file"
exit 1
fi
done