Random

Approve all your Github Pull Requests at once from the CLI


I had a bunch Pull Requests open for review. All of them were dependency updates by the great Dependabot. Usually I merge these manually if all builds are green with a small check of the changes.

Today I felt lazy and wondered if it was possible to approve them all at once. The Github web interface does not provide a feature for that (probably for good reasons).

Recently Github released their pretty great cli tool and I figured that should be able to do the job. And it does:

gh pr list | awk '{print $1}' | parallel 'gh pr review {} --approve'

Use at your own risk!