如果可能,如何配置公共(public) GitHub 存储库以便自动分配所有问题?
通过https://github.com/blog/831-issues-2-0-the-next-generation,我可以得到最接近的, 是:
"You can mass-edit from this page: close, reopen, add labels, assign to users or add to milestones."
由于 gitHub Web UI 不允许我按受让人对问题进行排序,因此要让事情井井有条,比我希望的要困难一些。
想法?提前致谢。
最佳答案
自动化该过程的一种方法是通过脚本:
GitHub API V3 应该可以做到这一点。 , 及其 Issue API
PATCH /repos/:owner/:repo/issues/:number
(您可以使用
POST
代替 PATCH
)This script导入和分配案例:
// GitHub API endpoint for /repos/:user/:repo/issues
const GH_API = "https://USER:PASS@api.github.com/repos/%s/%s/issues"
// GitHub logins to assign tickets to. The first one is considered the default.
var validAssignees = []string{"LOGIN1", "LOGIN2"}
...
// Posts the new JSON-encoded issue to GitHub using the given ticket.
func postIssue(ticket Ticket, repo string) {
bodyType := "application/json"
jsonIssue := strings.NewReader(encodeTicket(ticket))
url := fmt.Sprintf(GH_API, repo)
resp, respErr := http.Post(url, bodyType, jsonIssue)
checkError(respErr)
fmt.Println(resp.Status)
http.DumpResponse(resp, true)
}
关于github - 如何配置 GitHub 以便自动分配所有问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20304871/