Last active
November 5, 2023 09:03
-
-
Save sxzz/71e06347027dc221492cd3e360683a2d to your computer and use it in GitHub Desktop.
GitHub CLI scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# Merge all dependency PRs | |
gh search prs --owner sxzz is:open author:app/renovate archived:false --json "url" --jq ".[].url" | xargs -I {} gh pr merge {} --squash --auto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment