DEV Community

Justin Poehnelt
Justin Poehnelt

Posted on • Originally published at justin.poehnelt.com on

3 1

Rebasing All Dependabot Pull Requests

The GitHub cli tool gh now has a search feature! I recently had a use case requiring DependaBot to rebase all pull requests across the GitHub organization repositories.

The following shell command did the trick by piping the output of gh search prs to gh pr comment:

gh search prs \
  --owner googlemaps \ # replace with GitHub owner
  --state open \
  --label dependencies \
  --limit 200 \
  --json "url" --jq ".[] | .url" \
| xargs -n 1 -I{} \
  gh pr comment -b "@dependabot rebase" {}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay