Commit 40f0a79 1 parent d1852f5 commit 40f0a79 Copy full SHA for 40f0a79
File tree 3 files changed +68
-1
lines changed
3 files changed +68
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Validate JSON Schema
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ validate-json :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - name : Checkout repository
10
+ uses : actions/checkout@v3
11
+
12
+ - name : Validate Toolset JSON files against schema
13
+ uses : cardinalby/schema-validator-action@v3
14
+ with :
15
+ file : ' **/toolset-*.json'
16
+ schema : ' schemas/toolset-schema.json'
Original file line number Diff line number Diff line change 21
21
],
22
22
"shellcheck.customArgs" : [
23
23
" -x"
24
- ]
24
+ ],
25
+ "json.schemas" : [
26
+ {
27
+ "fileMatch" : [
28
+ " **/toolset-*.json"
29
+ ],
30
+ "url" : " ./schemas/toolset-schema.json"
31
+ }
32
+ ]
33
+
25
34
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " http://json-schema.org/draft-07/schema#" ,
3
+ "type" : " object" ,
4
+ "patternProperties" : {
5
+ "^.*$" : {
6
+ "if" : {
7
+ "type" : " object" ,
8
+ "required" : [
9
+ " version"
10
+ ],
11
+ "properties" : {
12
+ "version" : {
13
+ "type" : " string" ,
14
+ "pattern" : " ^[0-9]+\\ .[0-9]+\\ .[0-9]+.*$"
15
+ }
16
+ }
17
+ },
18
+ "then" : {
19
+ "required" : [
20
+ " pinnedReason"
21
+ ],
22
+ "properties" : {
23
+ "pinnedDetails" : {
24
+ "type" : " object" ,
25
+ "properties" : {
26
+ "reason" : {
27
+ "type" : " string"
28
+ },
29
+ "link" : {
30
+ "type" : " string"
31
+ },
32
+ "review-at" : {
33
+ "type" : " string" ,
34
+ "format" : " date"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments