Skip to content

Commit 40f0a79

Browse files
PoC: Require details tracked when patch version pinned
1 parent d1852f5 commit 40f0a79

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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'

.vscode/settings.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,14 @@
2121
],
2222
"shellcheck.customArgs": [
2323
"-x"
24-
]
24+
],
25+
"json.schemas": [
26+
{
27+
"fileMatch": [
28+
"**/toolset-*.json"
29+
],
30+
"url": "./schemas/toolset-schema.json"
31+
}
32+
]
33+
2534
}

schemas/toolset-schema.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
}

0 commit comments

Comments
 (0)