Skip to content

Commit

Permalink
App.GitHub.org_user_list/1 now returns *all* 521 users in a single AP…
Browse files Browse the repository at this point in the history
…I request #17
  • Loading branch information
nelsonic committed Dec 26, 2024
1 parent adf6abe commit 653be14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/app/github.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ defmodule App.GitHub do
data
end

@doc """
`org_user_list/1` Returns the list of GitHub users for an org.
"""
def org_user_list(orgname) do
Logger.info "Fetching org user list for #{orgname}"
{_status, data, _res} =
Tentacat.Organizations.Members.list(@client, orgname)
data
end
end
6 changes: 6 additions & 0 deletions test/app/github_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ defmodule App.GitHubTest do
user = GitHub.user(username) # |> dbg
assert user.public_repos > 30
end

test "App.org_user_list/1" do
orgname = "dwyl"
list = GitHub.org_user_list(orgname)
assert length(list) > 500
end
end

0 comments on commit 653be14

Please sign in to comment.