peppa/apps/web/app/api/hooks/gitea/route.ts
Асель cae49d5b54 PEP-57: CI feedback — check runs, red checks back to the agent, review/merge gates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:37:10 +05:00

19 lines
631 B
TypeScript

import { handleGiteaHook } from "@peppa/runner";
import { db } from "@/lib/db";
export const dynamic = "force-dynamic";
/**
* Gitea webhooks and CI step reports of project repos (PEP-57). No login: each request is
* signed (X-Gitea-Signature, HMAC-SHA256 of the body) with the project's secret.
*/
export async function POST(req: Request) {
const body = await req.text();
const r = await handleGiteaHook(db, {
event: req.headers.get("x-peppa-event") ?? req.headers.get("x-gitea-event") ?? "",
signature: req.headers.get("x-gitea-signature"),
body,
});
return Response.json(r.body, { status: r.status });
}