Heroku应用设置API不适用于私有git存储库

时间:2019-03-27 14:34:55

标签: github heroku heroku-api

我正在创建一个仪表板来管理我的heroku应用,尤其是要在heroku上部署新应用。

我正在使用heroku API进行应用程序设置(https://devcenter.heroku.com/articles/platform-api-reference#app-setup-create)和node-heroku-client(https://github.com/heroku/node-heroku-client)。

尝试使用私有git存储库创建新应用时遇到问题。

heroku.post('/app-setups', {body: 
  source_blob: {
    url: 'https://github.com/my_account/my_private_repos/tarball/master/'
  }
})

当url是公共git仓库时,它可以正常工作,但是当它是私有git仓库时,我从heroku中收到以下错误:

failure_message: "could not find the source blob"

任何想法如何将其API与私有git repos url一起使用?

编辑:我找到了解决方法

要使其与git private repos一起使用,网址应如下:

{
  url: "https://api.github.com/repos/<username>/<repo>/tarball/<branch>?access_token=<github-token>"
}

1 个答案:

答案 0 :(得分:0)

我在这里发布解决方案。

要使其与git private repos一起使用,网址应如下:

{
  url: "https://api.github.com/repos/<username>/<repo>/tarball/<branch>?access_token=<github-token>"
}
相关问题