【发布时间】:2019-08-18 04:10:49
【问题描述】:
我正在创建一个仪表板来管理我的 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 应如下所示:
{
url: "https://api.github.com/repos/<username>/<repo>/tarball/<branch>?access_token=<github-token>"
}
【问题讨论】:
-
感谢您用您的解决方案更新您的问题!
-
@Alexis 将您的编辑添加为答案。
-
谢谢你的提问,我刚做了。希望对你有帮助:)
-
此方法已弃用任何其他解决方法?
标签: github heroku heroku-api