feat(pull): add get_comments method to pull_request_read

List regular PR discussion comments via the issue comments endpoint,
since Gitea pull requests are issues internally. Reuses the issue
package's slim comment shape with attachment inlining.

Co-Authored-By: Codet <codet@commitgo.dev> (GPT-5-Codex)
This commit is contained in:
Lunny Xiao
2026-08-23 23:36:53 -07:00
parent 815a0e26aa
commit 2ffb16ba1e
3 changed files with 140 additions and 2 deletions
+14
View File
@@ -164,3 +164,17 @@ func slimReviewComments(comments []*gitea_sdk.PullReviewComment) []map[string]an
}
return out
}
func slimComment(c *gitea_sdk.Comment) map[string]any {
if c == nil {
return nil
}
return map[string]any{
"id": c.ID,
"body": c.Body,
"user": slim.UserLogin(c.Poster),
"html_url": c.HTMLURL,
"created_at": c.Created,
"updated_at": c.Updated,
}
}