Skip to content

ghpr review wait

ghpr review wait - poll until a review is complete or timeout is reached

Terminal window
ghpr review wait <pr> [options]

Continuously poll a pull request’s review status until a review is submitted or the timeout is reached. This is useful in CI/CD pipelines where you need to wait for human or Copilot review before proceeding.

The command stops polling when an approval, changes requested, or commented review is found.

ArgumentRequiredDescription
<pr>YesPull request number
OptionDefaultDescription
-t, --token <token>-GitHub personal access token
-r, --repo <owner/repo>-Repository in owner/repo format
--timeout <seconds>300Maximum wait time in seconds
--interval <seconds>10Poll interval in seconds
CodeMeaning
0Review approved
1Changes requested
2Timeout reached
3Error (API error, auth error)

Outputs the current check status after each poll interval, showing progress toward review completion.

Terminal window
ghpr review wait 123

Wait up to 5 minutes (default), checking every 10 seconds.

Terminal window
ghpr review wait 123 --timeout 600 --interval 30

Wait up to 10 minutes, checking every 30 seconds.

Terminal window
# Request Copilot review and wait for it
ghpr review request $PR_NUMBER copilot
ghpr review wait $PR_NUMBER --timeout 300 --interval 30
# Check exit code
if [ $? -eq 0 ]; then
echo "PR approved!"
elif [ $? -eq 1 ]; then
echo "Changes requested"
exit 1
fi
Terminal window
ghpr review wait 123 --timeout 60 || {
exit_code=$?
if [ $exit_code -eq 2 ]; then
echo "Timed out waiting for review"
fi
exit $exit_code
}