Skip to content

Instantly share code, notes, and snippets.

@victorlin
Last active November 26, 2025 02:16
Show Gist options
  • Select an option

  • Save victorlin/7186a95d467696574be846c465dd5e73 to your computer and use it in GitHub Desktop.

Select an option

Save victorlin/7186a95d467696574be846c465dd5e73 to your computer and use it in GitHub Desktop.
Script to facilitate batched review of dependabot PRs.
#!/usr/bin/env bash
# Script to facilitate batched review of dependabot PRs
# Change these values
TITLE="Bump actions/checkout from 5 to 6"
COMMENT="Breaking change is a new minimum Actions Runner version for Docker container action scenarios. Should not impact existing usage."
gh search prs \
--state=open \
--author=app/dependabot \
--owner=nextstrain \
"$TITLE" \
--json=repository,number,title,url \
--jq '.[] | select(.title | ascii_downcase | contains("'"$TITLE"'" | ascii_downcase))' | \
while read -r line; do
if [ -n "$line" ]; then
repo=$(echo "$line" | jq -r '.repository.nameWithOwner')
pr_number=$(echo "$line" | jq -r '.number')
url=$(echo "$line" | jq -r '.url')
echo "# $url"
echo "# Checks:"
gh pr checks $pr_number --repo $repo --json "state" --jq ".[].state" | sort | uniq -c
echo "# handy commands:"
echo "gh pr review $pr_number --repo $repo --approve --body \"$COMMENT\""
echo "gh pr merge --squash $pr_number --repo $repo"
echo ""
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment