Skip to content

Instantly share code, notes, and snippets.

@abacigalup-eb
Last active October 15, 2021 15:37
Show Gist options
  • Save abacigalup-eb/31ae9fd930032094926cef0fa0c3793a to your computer and use it in GitHub Desktop.
Save abacigalup-eb/31ae9fd930032094926cef0fa0c3793a to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if ! which gh 2>&1 > /dev/null; then
echo 'Missing gh cli'
exit 1
fi
if [ $# -eq 0 ]; then
echo "usage: $0 <github query>"
echo "Read more in https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests"
exit 0
fi
# summary
gh pr list --search "$*"
echo "Relevant commands: view, diff, checks, comment, review, edit"
echo "Type <command> help for more info"
echo "Press C^D to go to next PR."
echo ""
set +e
# repl on each PR
for pr in $(gh pr list --search "$*" --json number -q ".[].number"); do
gh pr view --comments $pr
while read -p "gh pr (#$pr)> " args; do gh pr $args $pr; done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment