diff --git a/createreadmes.py b/createreadmes.py index 39964b2..97268ed 100644 --- a/createreadmes.py +++ b/createreadmes.py @@ -218,6 +218,7 @@ from typing import TypedDict class Artifact(TypedDict): file: str lines: NotRequired[list[int]] + repository: NotRequired[str] class SecurityRule(TypedDict): status: str @@ -253,6 +254,8 @@ properties: properties: file: type: string + repository: + type: string lines: type: array items: @@ -306,7 +309,7 @@ rule_names = { def artifact_to_string(info: ModelInformation, artifact: Artifact): file = Path(artifact['file']) filename = file.name - file_url = f"https://github.com/{info['slug']}/blob/{info.get('branch', 'master')}/{artifact['file']}" + file_url = f"https://github.com/{artifact.get('repository', info['slug'])}/blob/{info.get('branch', 'master')}/{artifact['file']}" lines = artifact.get("lines") if lines is None: return f"- {filename}: [File]({file_url})" diff --git a/security_rules_schema.json b/security_rules_schema.json index e59c538..98bafe9 100644 --- a/security_rules_schema.json +++ b/security_rules_schema.json @@ -27,6 +27,7 @@ "type": "object", "additionalProperties": false, "properties": { + "repository": { "type": "string" }, "file": { "type": "string" }, "lines": { "type": "array", "items": { "type": "integer" } } },