feat: add schema rs

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2026-02-03 23:32:51 +01:00
parent 41d7b76685
commit 091c09450e
9 changed files with 378 additions and 21 deletions

165
templates/fe/schema.json Normal file
View File

@@ -0,0 +1,165 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ForgeConfig",
"type": "object",
"properties": {
"filter": {
"$ref": "#/$defs/Filter"
},
"policies": {
"$ref": "#/$defs/Policies"
},
"schedule": {
"$ref": "#/$defs/ForgeSchedule"
}
},
"oneOf": [
{
"description": "GitHub forge",
"type": "object",
"properties": {
"github": {
"type": "object",
"properties": {
"credentials": {
"description": "Credentials",
"$ref": "#/$defs/GitHubCredentials"
},
"organisation": {
"description": "Organisation",
"type": "string"
}
},
"required": [
"credentials",
"organisation"
]
}
},
"required": [
"github"
]
}
],
"unevaluatedProperties": false,
"$defs": {
"Filter": {
"title": "Filter",
"type": "object",
"properties": {
"allow": {
"title": "Allow",
"description": "Allowed repositories, uses regex patterns\n\n```toml\nallow = [\".*\", \"^something-.*$\"]\n````",
"type": "array",
"items": {
"$ref": "#/$defs/regex"
}
},
"deny": {
"title": "Deny",
"description": "Denied repositories, uses regex patterns\n\n```toml\ndeny = [\".*\", \"^something-.*$\"]\n````",
"type": "array",
"items": {
"$ref": "#/$defs/regex"
}
}
},
"additionalProperties": false
},
"ForgeSchedule": {
"oneOf": [
{
"type": "object",
"properties": {
"cron": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"cron"
]
},
{
"type": "object",
"properties": {
"interval": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"interval"
]
},
{
"type": "object",
"properties": {
"once": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"once"
]
}
]
},
"GitHubCredentials": {
"description": "GitHubCredentials",
"oneOf": [
{
"description": "Token",
"type": "object",
"properties": {
"token": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"token"
]
},
{
"description": "Get token from env key",
"type": "object",
"properties": {
"token_env": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"token_env"
]
}
]
},
"Policies": {
"type": "object",
"properties": {
"squash_merge_only": {
"$ref": "#/$defs/PolicyOption"
}
},
"additionalProperties": false
},
"PolicyOption": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
},
"regex": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "string",
"type": "string"
}
}
}