github - 如何配置 GitHub 以便自动分配所有问题?

标签 github

如果可能,如何配置公共(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/

    相关文章:

    git - 如何避免使用 github 提交空格

    windows - 如何使用 Windows 命令行在 Web 上打开当前的 GitHub 分支?

    javascript - 无法修改和测试 fork 的 GitHub 库 - npm 错误!找不到版本

    reactjs - 了解 React 部署 - "Deploying a React App to Github Pages"教程中到底发生了什么?

    github - 我怎么只有gh-pages分支?

    curl - 使用 Git 的 libcurl 中不支持或禁用协议(protocol) https

    windows-7 - Git Push origin Master 挂起 - cygwin w/windows 7

    github:全局更改 user.name 后访问被拒绝

    github - 无法将主机添加到已知主机列表

    github - 如何恢复我不记得的 github 电子邮件?