Don't require a body for comment PR reviews (#399)
fixes #372 Co-authored-by: Norwin <git@nroo.de> 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 <art27@cantab.net> Co-authored-by: Norwin <noerw@noreply.gitea.io> Co-committed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
parent
1731e00ebd
commit
802bdf7dc5
|
@ -52,7 +52,7 @@ func ReviewPull(ctx *context.TeaContext, idx int64) error {
|
||||||
|
|
||||||
// comment
|
// comment
|
||||||
var promptOpts survey.AskOpt
|
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)
|
promptOpts = survey.WithValidator(survey.Required)
|
||||||
}
|
}
|
||||||
err = survey.AskOne(&survey.Multiline{Message: "Concluding comment:"}, &comment, promptOpts)
|
err = survey.AskOne(&survey.Multiline{Message: "Concluding comment:"}, &comment, promptOpts)
|
||||||
|
|
Loading…
Reference in New Issue