Files
forge-enforce/templates/fe/schema.json
2026-02-06 13:02:33 +01:00

159 lines
3.5 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ForgeConfig",
"type": "object",
"properties": {
"filter": {
"$ref": "#/$defs/Filter"
},
"policies": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/PolicyOption"
}
},
"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"
]
}
]
},
"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"
}
}
}