Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion internal/webhook/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ func (h *Handler) handlePRReview(ctx context.Context, w http.ResponseWriter, bod
reviewID := event.Review.GetID()
reviewBody := event.Review.GetBody()

log.Infof("Received PR review for PR #%d: %s, review ID: %d", prNumber, prTitle, reviewID)
action := event.GetAction()
log.Infof("Received PR review for PR #%d: %s, review ID: %d, action: %s", prNumber, prTitle, reviewID, action)

// 检查是否包含批量处理命令
if event.Review == nil || event.PullRequest == nil {
Expand All @@ -286,6 +287,13 @@ func (h *Handler) handlePRReview(ctx context.Context, w http.ResponseWriter, bod
return
}

// 只处理 "submitted" 事件,避免在编辑或其他操作时重复触发
if action != "submitted" {
log.Debugf("Ignoring PR review event with action: %s (only process 'submitted' events)", action)
w.WriteHeader(http.StatusOK)
return
}

log.Infof("Processing PR review: review_body_length=%d", len(reviewBody))

// 检查 review body 是否包含 /continue 或 /fix 命令
Expand Down