Skip to content

Instantly share code, notes, and snippets.

@sarkis
Forked from micahhausler/jq-filter.sh
Created January 8, 2019 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarkis/97285dda819d542e3658a667aa041b75 to your computer and use it in GitHub Desktop.
Save sarkis/97285dda819d542e3658a667aa041b75 to your computer and use it in GitHub Desktop.
GitHub collaborator finder
# Go to https://developer.github.com/v4/explorer/ and enter the graphql query with the query veriable:
# {"queryString": "your-githubuser-name"}
cat results.json |
jq '.data.user.repositories.edges[] | { Count: .node.collaborators.totalCount, Repo: .node.name} | select(.Count > 2)'
query listCollaborators($queryString: String!) {
rateLimit {
cost
remaining
resetAt
}
user(login: $queryString) {
name
repositories(first: 100, orderBy: {field: NAME, direction: ASC}) {
edges {
node {
name
collaborators(first: 10, affiliation: ALL) {
totalCount
}
}
}
}
}
}
@dmpeters
Copy link

In clojures this would be...

query listCollaborators($queryString:String!)(
  rateLimit(((cost)remaining)resetAt))(
  user(login:$queryString)(
    ((name)repositories((((
      first:100)orderBy)(
        field:NAME,direction:ASC))(
          edges(node(name(collaborators(first:10,affiliation:ALL)))))(
            totalCount))))))))))

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