Allow PR review with comments only #570

Merged
jolheiser merged 2 commits from arkamar/go-sdk:allow-comments-only-review into master 2022-05-01 19:09:35 +00:00

View File

@ -116,7 +116,7 @@ type ListPullReviewsOptions struct {
// Validate the CreatePullReviewOptions struct
func (opt CreatePullReviewOptions) Validate() error {
if opt.State != ReviewStateApproved && len(strings.TrimSpace(opt.Body)) == 0 {
if opt.State != ReviewStateApproved && len(opt.Comments) == 0 && len(strings.TrimSpace(opt.Body)) == 0 {
return fmt.Errorf("body is empty")
}
for i := range opt.Comments {