This is an automated email from the ASF dual-hosted git repository.
kumfo pushed a commit to branch feat/reviewer-basic
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git
The following commit(s) were added to refs/heads/feat/reviewer-basic by this
push:
new 5a6266a fix(review): fixed the review switch check
5a6266a is described below
commit 5a6266ae6f1075616ccb7c3be87fd97a15a5824d
Author: kumfo <[email protected]>
AuthorDate: Tue Apr 16 14:42:46 2024 +0800
fix(review): fixed the review switch check
---
reviewer-basic/basic.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/reviewer-basic/basic.go b/reviewer-basic/basic.go
index c4d2477..69a63c1 100644
--- a/reviewer-basic/basic.go
+++ b/reviewer-basic/basic.go
@@ -59,8 +59,8 @@ func (r *Reviewer) Info() plugin.Info {
func (r *Reviewer) Review(content *plugin.ReviewContent) (result
*plugin.ReviewResult) {
result = &plugin.ReviewResult{Approved: true, ReviewStatus:
plugin.ReviewStatusApproved}
- // If the post does not need review, return directly
- if !r.Config.PostNeedReview {
+ // this switch is true and have any other approved post, return directly
+ if r.Config.PostNeedReview &&
content.Author.ApprovedQuestionAmount+content.Author.ApprovedAnswerAmount > 1 {
return result
}
// If the author is admin, no need to review