orgs=`curl -H "Authorization: bearer $GH_TOKEN" -X POST -d " { \"query\": \"query { user(login: "KondaReddyR") { organizations(first: 10) { edges { node { login} } } } }\" } " https://api.github.com/graphql | jq -c .`
for org in $(echo "${orgs}" | jq -r '.data.user.organizations.edges[] | .node.login '); do
echo $org
done
Created
April 7, 2019 15:42
-
-
Save KondaReddyR/203e013005fbd9cb43fb5f12dc09c71a to your computer and use it in GitHub Desktop.
Github Api V4 Graphql Fetch Orgs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
List of Orgs and Repos