mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 19:16:48 +00:00
PoC: Require details tracked when patch version pinned
This commit is contained in:
16
.github/workflows/validate-json-schema.yml
vendored
Normal file
16
.github/workflows/validate-json-schema.yml
vendored
Normal 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
11
.vscode/settings.json
vendored
@@ -21,5 +21,14 @@
|
|||||||
],
|
],
|
||||||
"shellcheck.customArgs": [
|
"shellcheck.customArgs": [
|
||||||
"-x"
|
"-x"
|
||||||
]
|
],
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"**/toolset-*.json"
|
||||||
|
],
|
||||||
|
"url": "./schemas/toolset-schema.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
42
schemas/toolset-schema.json
Normal file
42
schemas/toolset-schema.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user