PoC: Require details tracked when patch version pinned

This commit is contained in:
lawrencegripper
2025-01-13 16:44:41 +00:00
parent d1852f561f
commit 40f0a79050
3 changed files with 68 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
name: Validate JSON Schema
on: [push, pull_request]
jobs:
validate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Validate Toolset JSON files against schema
uses: cardinalby/schema-validator-action@v3
with:
file: '**/toolset-*.json'
schema: 'schemas/toolset-schema.json'

11
.vscode/settings.json vendored
View File

@@ -21,5 +21,14 @@
],
"shellcheck.customArgs": [
"-x"
]
],
"json.schemas": [
{
"fileMatch": [
"**/toolset-*.json"
],
"url": "./schemas/toolset-schema.json"
}
]
}

View File

@@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"patternProperties": {
"^.*$": {
"if": {
"type": "object",
"required": [
"version"
],
"properties": {
"version": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+.*$"
}
}
},
"then": {
"required": [
"pinnedReason"
],
"properties": {
"pinnedDetails": {
"type": "object",
"properties": {
"reason": {
"type": "string"
},
"link": {
"type": "string"
},
"review-at": {
"type": "string",
"format": "date"
}
}
}
}
}
}
}
}