Initial open source GitHub PR review bot

This commit is contained in:
lezi-fun committed 2026-05-12 21:23:43 +08:00
commit c6bf0346b4
23 files changed
+4577

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import type { ReviewDecision, ReviewFinding } from "../types.js";
export function formatReviewBody(decision: ReviewDecision, unpostedFindings: ReviewFinding[]): string {
const lines = [
`## Automated review`,
"",
decision.summary,
"",
`Decision: ${decision.safeToMerge ? "safe to merge" : "changes requested"}`
];
if (unpostedFindings.length > 0) {
lines.push("", "Findings that could not be attached inline:");
for (const finding of unpostedFindings) {
lines.push(
"",
`- ${finding.path}:${finding.line} [${finding.severity}] ${finding.title}`,
` ${finding.body}`
);
}
}
return lines.join("\n");
}