From e73c881c644cc088593c0fc9f76961af6b283326 Mon Sep 17 00:00:00 2001 From: Vlad Mocanu Date: Thu, 26 Feb 2026 08:42:17 +0200 Subject: [PATCH] fix: skip commentBody validation for Forgejo review comment events Forgejo's pull_request_review_comment payload doesn't include the comment body. The Forgejo data fetcher retrieves it via REST instead. Skip the COMMENT_BODY required check on Forgejo to avoid crashing. Co-Authored-By: Claude Opus 4.6 --- src/create-prompt/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/create-prompt/index.ts b/src/create-prompt/index.ts index a257833..e25683f 100644 --- a/src/create-prompt/index.ts +++ b/src/create-prompt/index.ts @@ -178,7 +178,9 @@ export function prepareContext( "IS_PR must be true for pull_request_review_comment event", ); } - if (!commentBody) { + // Forgejo's pull_request_review_comment payload lacks the comment body; + // the Forgejo data fetcher retrieves it via REST instead. + if (!commentBody && detectPlatform() !== "forgejo") { throw new Error( "COMMENT_BODY is required for pull_request_review_comment event", ); @@ -188,7 +190,7 @@ export function prepareContext( isPR: true, prNumber, ...(commentId && { commentId }), - commentBody, + commentBody: commentBody || "", ...(claudeBranch && { claudeBranch }), ...(baseBranch && { baseBranch }), };