From 802bdf7dc5ebf38bbac767ee581a39810f0ebce1 Mon Sep 17 00:00:00 2001 From: Norwin Date: Thu, 23 Sep 2021 02:18:25 +0800 Subject: [PATCH] Don't require a body for comment PR reviews (#399) fixes #372 Co-authored-by: Norwin Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/399 Reviewed-by: 6543 <6543@obermui.de> Reviewed-by: Andrew Thornton Co-authored-by: Norwin Co-committed-by: Norwin --- modules/interact/pull_review.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/interact/pull_review.go b/modules/interact/pull_review.go index 1052dcd..ea766d7 100644 --- a/modules/interact/pull_review.go +++ b/modules/interact/pull_review.go @@ -52,7 +52,7 @@ func ReviewPull(ctx *context.TeaContext, idx int64) error { // comment var promptOpts survey.AskOpt - if state == gitea.ReviewStateComment || state == gitea.ReviewStateRequestChanges { + if (state == gitea.ReviewStateComment && len(codeComments) == 0) || state == gitea.ReviewStateRequestChanges { promptOpts = survey.WithValidator(survey.Required) } err = survey.AskOne(&survey.Multiline{Message: "Concluding comment:"}, &comment, promptOpts)