Create a pull request comment in a repo with no issues using the GitHub API

According to the GitHub v3 API for pull requests

Comments on pull requests can be managed via the Issue Comments API.

In the Issues API I should be able to create a comment with

POST /repos/:owner/:repo/issues/:number/comments

Unfortunately the repo I'm working with has Issues disabled so when I try that, I get the 410 error message

Issues are disabled for this repo

How can I create a pull request comment in a repo with no issues using the GitHub API?


Can you browse to?:

https://github.com/:owner/:repo/issues

If you get a 404 there, then it sounds like you just need to enable Issues under Features on the repo's settings page:

https://github.com/:owner/:repo/settings

Edit: Ah, you don't want to work with issues at all. Instead of working with an issue number, you need to work with the pull request number, and simply post a comment that way:

POST /repos/:owner/:repo/pulls/:number/comments

{
  "body": "Nice change",
  "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "path": "file1.txt",
  "position": 4
}

See the Pull Request Review Comments API for more.

链接地址: http://www.djcxy.com/p/68530.html

上一篇: 如何查看我在Github上观看的所有问题?

下一篇: 使用GitHub API在回购库中创建拉取请求注释并不存在任何问题