List all contributors to a private github repository using github api

394 views Asked by At

I know it is possible to do this for a public repository (GET /repos/:owner/:repo/contributors) but I am wondering if there is a way to do this for private repositories that an authenticated user using my app is a member of. Also, I am using octokit.rb gem so any answers in that context are much appreciated.

1

There are 1 answers

0
Juanito Fatas On BEST ANSWER

if there is a way to do this for private repositories that an authenticated user using my app is a member of.

Create an Octokit client with this authenticated user:

client = Octokit::Client.new(access_token: authenticated_use.token)

Then get list of collaborators from a repository:

client.collaborators("octokit/octokit.rb")