@@ -875,19 +875,19 @@ func (g *Git) WritePRBody(prNumber int, body string) error {
875875 return nil
876876}
877877
878- func (g * Git ) ListPRComments (prNumber int ) ([]* github.PullRequestComment , error ) {
879- comments , _ , err := g .client .PullRequests .ListComments (context .Background (), os .Getenv ("GITHUB_REPOSITORY_OWNER" ), GetRepo (), prNumber , nil )
878+ func (g * Git ) ListIssueComments (prNumber int ) ([]* github.IssueComment , error ) {
879+ comments , _ , err := g .client .Issues .ListComments (context .Background (), os .Getenv ("GITHUB_REPOSITORY_OWNER" ), GetRepo (), prNumber , nil )
880880 if err != nil {
881881 return nil , fmt .Errorf ("failed to get PR comments: %w" , err )
882882 }
883883
884884 return comments , nil
885885}
886886
887- func (g * Git ) DeletePRComment (commentID int64 ) error {
888- _ , err := g .client .PullRequests .DeleteComment (context .Background (), os .Getenv ("GITHUB_REPOSITORY_OWNER" ), GetRepo (), commentID )
887+ func (g * Git ) DeleteIssueComment (commentID int64 ) error {
888+ _ , err := g .client .Issues .DeleteComment (context .Background (), os .Getenv ("GITHUB_REPOSITORY_OWNER" ), GetRepo (), commentID )
889889 if err != nil {
890- return fmt .Errorf ("failed to delete PR comment: %w" , err )
890+ return fmt .Errorf ("failed to delete issue comment: %w" , err )
891891 }
892892
893893 return nil
@@ -912,6 +912,19 @@ func (g *Git) WritePRComment(prNumber int, fileName, body string, line int) erro
912912 return nil
913913}
914914
915+ func (g * Git ) WriteIssueComment (prNumber int , body string ) error {
916+ comment := & github.IssueComment {
917+ Body : github .String (sanitizeExplanations (body )),
918+ }
919+
920+ _ , _ , err := g .client .Issues .CreateComment (context .Background (), os .Getenv ("GITHUB_REPOSITORY_OWNER" ), GetRepo (), prNumber , comment )
921+ if err != nil {
922+ return fmt .Errorf ("failed to create issue comment: %w" , err )
923+ }
924+
925+ return nil
926+ }
927+
915928func sanitizeExplanations (str string ) string {
916929 // Remove ANSI sequences
917930 ansiEscape := regexp .MustCompile (`\x1b[^m]*m` )
0 commit comments