feat: adapt pullfrog for gitea + ollama
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const FOOTER_MARKER = "<!-- shockbot-footer -->";
|
||||
|
||||
export function buildShockbotFooter(params?: {
|
||||
model?: string | undefined;
|
||||
}): string {
|
||||
const modelPart = params?.model ? ` · \`${params.model}\`` : "";
|
||||
return `\n\n<br>\n\n---\n${FOOTER_MARKER}\n*Reviewed by [shockbot](https://git.shockvpn.com)${modelPart}*`;
|
||||
}
|
||||
|
||||
export function stripExistingFooter(body: string): string {
|
||||
const markerIdx = body.lastIndexOf(FOOTER_MARKER);
|
||||
if (markerIdx === -1) return body;
|
||||
// walk back past "\n\n---\n" before the marker
|
||||
const beforeMarker = body.slice(0, markerIdx);
|
||||
const stripped = beforeMarker.replace(/\s*\n+---\n$/, "").trimEnd();
|
||||
return stripped;
|
||||
}
|
||||
Reference in New Issue
Block a user