Skip to content

Add API to retrieve list of contributors #147

@vbauer

Description

@vbauer

Now, I'm using the following workaround:

java

    public GHUser[] getContributors(final GHRepository repository) throws Exception {
        final Field field = GHRepository.class.getDeclaredField("root");
        field.setAccessible(true);
        final GitHub gitHub = (GitHub) field.get(repository);

        final GHUser owner = repository.getOwner();
        final String login = owner.getLogin();
        final String name = repository.getName();

        final Method retrieveMethod = GitHub.class.getDeclaredMethod("retrieve");
        retrieveMethod.setAccessible(true);
        final Object request = retrieveMethod.invoke(gitHub);

        final Method toMethod = request.getClass().getDeclaredMethod("to", String.class, Class.class);
        toMethod.setAccessible(true);
        return (GHUser[]) toMethod.invoke(request, "/repos/" + login + "/" + name + "/contributors", GHUser[].class);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions