Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active Mar 30, 2022
Embed
What would you like to do?
GitHub - Get All Your PRs As JSON
#!/usr/bin/env bash
# Install GH CLI client
brew install gh
# Configure organisation and username variables
ORG="orgname"
USER="username"
# Retrieve pull request JSON
# @see: https://github.com/cli/cli/issues/1268
gh api --method GET /search/issues --raw-field q='is:pr user:$ORG author:$USER' --paginate | jq 'reduce inputs as $i (.; . += $i)' > PRs.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment