-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.05 KB
/
Copy pathrttcode-validate.yml
File metadata and controls
45 lines (39 loc) · 1.05 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
name: RTTcode Validation
on:
push:
paths:
- "docs/**.json"
- "docs/schemas/**.json"
- ".github/workflows/rttcode-validate.yml"
pull_request:
paths:
- "docs/**.json"
- "docs/schemas/**.json"
jobs:
validate-rttcode:
name: Validate RTTcode Packets
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install JSON Schema validator
run: npm install -g ajv-cli
- name: Validate RTTcode packets
run: |
echo "Validating RTTcode packets..."
for file in $(find docs -name "*.json"); do
if [[ "$file" == docs/schemas/* ]]; then
continue
fi
echo "Checking: $file"
ajv validate \
-s docs/schemas/rttcode.v1.json \
-d "$file" \
--strict=true \
|| exit 1
done