https://developer.github.com/v3/pulls/
我需要这样的公关评论
[
{
avartar : 'img_link',
author : 'MoonSupport',
description: 'dd\ntt',
},
{
avartar : 'img_link',
author : 'MoonSupport',
description: 'review1',
},
{
avartar : 'img_link',
author : 'MoonSupport',
description: 'review2',
}
]
有没有可以使用的API?
请找到它。
答案 0 :(得分:0)
使用API v3,您可以使用
获取PR注释https://api.github.com/repos/OWNER/REPO_NAME/issues/NUMBER/comments
this PR的示例:https://api.github.com/repos/mui-org/material-ui/issues/21214/comments
您可以使用:
https://api.github.com/repos/OWNER/REPO_NAME/pulls/NUMBER/comments
this PR的示例:https://api.github.com/repos/mui-org/material-ui/pulls/21214/comments
但这不包括评论正文(与Github Web UI中的注释处于同一级别)。以下获得评论的正文:
https://api.github.com/repos/OWNER/REPO_NAME/pulls/NUMBER/reviews
this PR的示例:https://api.github.com/repos/mui-org/material-ui/pulls/21214/reviews
使用GraphQL API来获取评论,评论和评论正文:
{
repository(name: "material-ui", owner: "mui-org") {
pullRequest(number: 21214) {
reviews(first: 100) {
nodes {
bodyText
createdAt
author {
login
}
comments(first: 100) {
nodes {
author {
login
}
body
}
}
}
}
comments(first: 100) {
nodes {
author {
login
}
createdAt
body
}
totalCount
}
}
}
}