Sometimes in the course of your job you might need to approve a bunch of pull requests that were automatically created.
The gh
cli is a handy tool to simplify this process.
In this example we'll approve all pull requests in the Foo
org that request you as a reviewer and contains autoscaling
:
for PR_URL in $(gh search prs org:Foo --review-requested @me --state open autoscaling --json url --jq ".[].url"); do
echo $PR_URL
gh pr review --approve $PR_URL
done