mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
fix: commentBody may be null (#706)
* fix: `commentBody` may be `null` This handles the cases where `pull_request_review` events have no comments (`commentBody` field is `null`). In those cases, the `null` value is converted to the empty string. The issue was testing `!commentBody` which was triggerring on empty strings as well. This guard was removed (which is the fix), but for clarity, the `commentBody` field was also made optional to make it clear that the comment may be missing. * fix: bun run format
This commit is contained in:
committed by
GitHub
parent
469fc9c1a4
commit
2acd1f7011
@@ -192,11 +192,6 @@ export function prepareContext(
|
||||
if (!isPR) {
|
||||
throw new Error("IS_PR must be true for pull_request_review event");
|
||||
}
|
||||
if (!commentBody) {
|
||||
throw new Error(
|
||||
"COMMENT_BODY is required for pull_request_review event",
|
||||
);
|
||||
}
|
||||
eventData = {
|
||||
eventName: "pull_request_review",
|
||||
isPR: true,
|
||||
|
||||
@@ -23,7 +23,7 @@ type PullRequestReviewEvent = {
|
||||
eventName: "pull_request_review";
|
||||
isPR: true;
|
||||
prNumber: string;
|
||||
commentBody: string;
|
||||
commentBody?: string; // May be absent for approvals without comments
|
||||
claudeBranch?: string;
|
||||
baseBranch?: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user