Skip to content

Commit 0cb02b4

Browse files
committed
Fix CI mermaid validation sandbox
1 parent 18e4562 commit 0cb02b4

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

scripts/validate_quality.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ def mermaid_command() -> list[str] | None:
9191
return None
9292

9393

94+
def mermaid_puppeteer_config(out_dir: Path) -> Path:
95+
config_path = out_dir / "puppeteer-config.json"
96+
config_path.write_text(
97+
json.dumps({"args": ["--no-sandbox", "--disable-setuid-sandbox"]}),
98+
encoding="utf-8",
99+
)
100+
return config_path
101+
102+
94103
def validate_mermaid(skip: bool) -> None:
95104
diagrams = iter_files(".mmd")
96105
if not diagrams:
@@ -103,8 +112,15 @@ def validate_mermaid(skip: bool) -> None:
103112
return
104113
with tempfile.TemporaryDirectory(prefix="skill-mermaid-") as tmp:
105114
out_dir = Path(tmp)
115+
puppeteer_config = mermaid_puppeteer_config(out_dir)
106116
for index, path in enumerate(diagrams, start=1):
107-
run([*cmd, "-i", str(path), "-o", str(out_dir / f"diagram-{index}.svg"), "-b", "white"])
117+
run([
118+
*cmd,
119+
"-i", str(path),
120+
"-o", str(out_dir / f"diagram-{index}.svg"),
121+
"-b", "white",
122+
"-p", str(puppeteer_config),
123+
])
108124
print("mermaid ok")
109125

110126

0 commit comments

Comments
 (0)