4

I'm creating a dashboard to manage my heroku apps and more particularly to deploy new apps on heroku.

I am using the heroku API for app-setups (https://devcenter.heroku.com/articles/platform-api-reference#app-setup-create) and the node-heroku-client (https://github.com/heroku/node-heroku-client).

I am encountering a problem when trying to create a new app with private git repository.

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

This works fine when the url is of a public git repos but when it is of a private git repos I get the following error from heroku:

failure_message: "could not find the source blob"

Any idea how can I use their API with private git repos urls ?

EDIT: I found the solution

For this to work with git private repos, the url should be as follow:

{
  url: "https://api.github.com/repos/<username>/<repo>/tarball/<branch>?access_token=<github-token>"
}
Alexis Santini
  • 331
  • 1
  • 3
  • 17

1 Answers1

3

I am posting here the SOLUTION.

For this to work with git private repos, the url should be as follow:

{
  url: "https://api.github.com/repos/<username>/<repo>/tarball/<branch>?access_token=<github-token>"
}
Alexis Santini
  • 331
  • 1
  • 3
  • 17