Skip to content

Instantly share code, notes, and snippets.

@wibus-wee
Forked from sxzz/GitHub.sh
Created November 14, 2022 11:10
Show Gist options
  • Save wibus-wee/a4c4fdf9782f67a7c23c277d9985d137 to your computer and use it in GitHub Desktop.
Save wibus-wee/a4c4fdf9782f67a7c23c277d9985d137 to your computer and use it in GitHub Desktop.
GitHub CLI scripts
# Get the owner of the repository to which you contributed (Pull Requests)
gh api graphql --paginate -f query='
query($endCursor: String) {
user(login: "username") {
pullRequests(first: 100, after: $endCursor, states: MERGED) {
nodes { repository { owner { login } } }
pageInfo {
hasNextPage
endCursor
}
}
}
}
' --jq '.data.user.pullRequests.nodes[].repository.owner.login' | sort | uniq -c | sort -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment