Compare commits
No commits in common. "probablycorey-patch-7" and "main" have entirely different histories.
probablyco
...
main
15
code.ts
15
code.ts
|
|
@ -27,6 +27,21 @@ const server = serve({
|
|||
return new Response(`DB is no more`)
|
||||
},
|
||||
},
|
||||
"/gitea/webhook": {
|
||||
POST: async (req) => {
|
||||
const payload = await req.json()
|
||||
const eventType = req.headers.get("X-Gitea-Event") || "unknown"
|
||||
console.log(`🌵 Received Gitea webhook ${eventType}`)
|
||||
|
||||
try {
|
||||
await handleGiteaWebhook(payload, eventType as any)
|
||||
return new Response("OK", { status: 200 })
|
||||
} catch (error) {
|
||||
const errorLog: ErrorLog = {
|
||||
timestamp: new Date().toISOString(),
|
||||
message: error instanceof Error ? error.message : String(error),
|
||||
stack: error instanceof Error ? error.stack : undefined,
|
||||
payload,
|
||||
}
|
||||
errors.push(errorLog)
|
||||
console.error("💥 Webhook error 💥")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user