I have Github Organization with the owners Owner1 and Owner2 and members Member1 and Member2. Now I created a new repository in this Organization and added two users as collaborators (user1 and user2) of this repo.
Now the result of postman
with the below GET request will result in the following:
Owner1
Owner2
user1
user2
POSTMAN request : https://<github-host>/api/v3/repos/<my-gihub-org>/<my-github-repo>/collaborators?per_page=100
But I am interested in listing only the collaborators i.e., user1 and user2; Not the owners.
Could someone please help me here..!
You can pass the
affiliation
parameter, in order to filter out any collaborators that directly work on a certain project.This should return just the people who work on a project, and not both collaborators and owners.
GitHub states that:
If it so happens that an owner is also a direct collaborator to this repo, then you have to do another request, where you check which person is the owner, and then filter them out from the collaborators request.
With this request, you can check which are the owners of an organization.
If you fancy using the new graphql feature, then you can query for