@@ -91,7 +91,7 @@ func handleGenericCommentEvent(pc plugins.Agent, e github.GenericCommentEvent) e
9191type githubClient interface {
9292 CreateComment (owner , repo string , number int , comment string ) error
9393 GetPullRequest (org , repo string , number int ) (* github.PullRequest , error )
94- EditPullRequest (org , repo string , number int , pr * github. PullRequest ) ( * github. PullRequest , error )
94+ UpdatePullRequest (org , repo string , number int , title , body * string , open * bool , branch * string , canModify * bool ) error
9595 GetIssue (org , repo string , number int ) (* github.Issue , error )
9696 EditIssue (org , repo string , number int , issue * github.Issue ) (* github.Issue , error )
9797}
@@ -144,13 +144,7 @@ func handleGenericComment(gc githubClient, isTrusted func(string) (bool, error),
144144 }
145145
146146 if gce .IsPR {
147- pr , err := gc .GetPullRequest (org , repo , number )
148- if err != nil {
149- return err
150- }
151- pr .Title = newTitle
152- _ , err = gc .EditPullRequest (org , repo , number , pr )
153- return err
147+ return gc .UpdatePullRequest (org , repo , number , & newTitle , nil , nil , nil , nil )
154148 }
155149 issue , err := gc .GetIssue (org , repo , number )
156150 if err != nil {
0 commit comments