Skip to content

Commit

Permalink
add json check (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
quarckster authored Sep 9, 2024
1 parent d83cf47 commit 6fa3b92
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/json_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

JSON_DIR=$1
RC=0

for JSON_FILE in $(ls "$JSON_DIR"); do
jq type 1>/dev/null < "$JSON_DIR/$JSON_FILE"
if [ $? -gt 0 ]; then
echo "Error in file: $JSON_DIR/$JSON_FILE"
RC=1
fi
done

exit "$RC"
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Lint

on:
pull_request:
paths:
- "secjson/**/**"

jobs:
build:
name: JSON lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check JSON files
run: .github/json_check.sh secjson

0 comments on commit 6fa3b92

Please sign in to comment.