diff --git a/pkg/cmd/issue/edit/edit_test.go b/pkg/cmd/issue/edit/edit_test.go index bf2a1c417..0df6d5e9f 100644 --- a/pkg/cmd/issue/edit/edit_test.go +++ b/pkg/cmd/issue/edit/edit_test.go @@ -574,14 +574,6 @@ func Test_editRun(t *testing.T) { { "errors": [ { "message": "test error" } ] }`, func(inputs map[string]interface{}) {}), ) - reg.Register( - httpmock.GraphQLMutationMatcher(`mutation IssueUpdate\b`, func(m map[string]interface{}) bool { - return m["id"] == "456" - }), - httpmock.GraphQLMutation(` - { "errors": [ { "message": "test error" } ] }`, - func(inputs map[string]interface{}) {}), - ) }, stdout: heredoc.Doc(` https://github.com/OWNER/REPO/issue/123 diff --git a/pkg/cmd/pr/shared/editable_http.go b/pkg/cmd/pr/shared/editable_http.go index 1475f978c..465bfda6c 100644 --- a/pkg/cmd/pr/shared/editable_http.go +++ b/pkg/cmd/pr/shared/editable_http.go @@ -58,23 +58,28 @@ func UpdateIssue(httpClient *http.Client, repo ghrepo.Interface, id string, isPR }) } - // updateIssue mutation does not support Actors so assignment needs to - // be in a separate request when our assignees are Actors. - if options.Assignees.Edited && options.Assignees.ActorAssignees { + if dirtyExcludingLabels(options) { wg.Go(func() error { - apiClient := api.NewClientFromHTTP(httpClient) - assigneeIds, err := options.AssigneeIds(apiClient, repo) + // updateIssue mutation does not support Actors so assignment needs to + // be in a separate request when our assignees are Actors. + if options.Assignees.Edited && options.Assignees.ActorAssignees { + apiClient := api.NewClientFromHTTP(httpClient) + assigneeIds, err := options.AssigneeIds(apiClient, repo) + if err != nil { + return err + } + + err = replaceActorAssigneesForEditable(apiClient, repo, id, assigneeIds) + if err != nil { + return err + } + } + err := replaceIssueFields(httpClient, repo, id, isPR, options) if err != nil { return err } - return replaceActorAssigneesForEditable(apiClient, repo, id, assigneeIds) - }) - } - - if dirtyExcludingLabels(options) { - wg.Go(func() error { - return replaceIssueFields(httpClient, repo, id, isPR, options) + return nil }) }