【问题标题】:Node.js, create a github issue on a private repoNode.js,在私有仓库上创建一个 github 问题
【发布时间】:2018-08-05 22:57:44
【问题描述】:

我有一个私人 github 存储库,我想跟踪我的应用程序的问题。 Github's API 描述了如何通过 POST 请求创建问题。我的问题是,这仅适用于公共存储库吗?我是否忽略了允许我的应用程序创建问题的简单解决方案?我已经尝试了下面的代码,但是没有运气。谢谢!

var request = require('request');

var bugReport = 

{
  "title": "Found a bug",
  "body": "I'm having a problem with this.",
  "labels": [
    "bug"
  ]
}

request.post(
    'https://api.github.com/repos/...(username).../...(repo).../issues',
    { json: bugReport },
    function (error, response, body) {
        if (!error && response.statusCode == 200) {
            console.log(body)
        }
    }
);

【问题讨论】:

    标签: node.js post github issue-tracking


    【解决方案1】:

    您需要使用具有正确范围的 OAuth 令牌进行身份验证,然后才能发布到私有存储库。见https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-20
      • 2011-02-21
      • 2020-06-17
      • 1970-01-01
      • 2012-08-27
      • 2021-11-08
      • 2012-10-19
      相关资源
      最近更新 更多