Fix pr-rework crash — guard against missing review.state
Publish Image / publish (push) Successful in 23s
Publish Image / publish (push) Successful in 23s
Gitea sends review objects without a state field in some cases. Use optional chaining and log the review payload for debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
81aee2f7fc
commit
2cdf68ddff
1 file changed
+2
-1
@@ -16,7 +16,8 @@ export function prRework(config: Config, queue: TaskQueue) {
|
||||
return c.text("ignored: not a reviewed event", 200);
|
||||
}
|
||||
|
||||
if (!event.review) {
|
||||
if (!event.review?.state) {
|
||||
console.log(`[pr-rework] ignored: no review state (review: ${JSON.stringify(event.review)})`);
|
||||
return c.text("ignored: no review data", 200);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user