Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the github api support getting a collaborator by username? #576

Closed
darewreck54 opened this issue Oct 28, 2019 · 2 comments · Fixed by #1431
Closed

Does the github api support getting a collaborator by username? #576

darewreck54 opened this issue Oct 28, 2019 · 2 comments · Fixed by #1431
Assignees

Comments

@darewreck54
Copy link

Is the following API supported?

GET /repos/:owner/:repo/collaborators/:username

https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator

Also does collaborator just imply a user that has write access?

I looked at the code but i'm not seeing it in the GHRepository.java file. Wanted to verify if I was just not seeing it?

Thanks,
Derek

@tedyoung
Copy link

tedyoung commented Jun 3, 2021

I came across a need for this behavior, i.e., checking if a single user was already a Collaborator on a Repository, so I don't have to fetch the entire list each time (or deal with caching it).

It seems fairly straightforward to implement, as the API returns either a 204 (user is a collaborator) or 404 (they're not), and is similar to the hasAssignee code.

I can submit a pull request to implement this if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants