是否有适用于提交GitHub问题的API?
当我遇到意外问题时,我希望能够为用户提供自动报告问题的选项。
是否有适用于提交GitHub问题的API?
当我遇到意外问题时,我希望能够为用户提供自动报告问题的选项。
这是GitHub API页面,详细介绍了如何编程创建问题:
https://developer.github.com/v3/issues/#create-an-issue
例如,从文档中:
向/repos/:owner/:repo/issues
发送POST请求,并使用以下JSON格式:
{
"title": "Found a bug",
"body": "I'm having a problem with this.",
"assignee": "octocat",
"milestone": 1,
"labels": [
"Label1",
"Label2"
]
}
您还可以通过向/repos/:owner/:repo/issues/:number
发送PATCH请求来以编程方式编辑问题。
你也可以使用(2021)GitHub CLI 'gh
'。
在你的情况下:gh issue create
。
例如:
gh issue create --title "I found a bug" --body "Nothing works"
(希望您的问题描述会比这稍微详细一些!)