Last active
March 4, 2026 00:49
-
-
Save victorlin/7186a95d467696574be846c465dd5e73 to your computer and use it in GitHub Desktop.
Script to facilitate batched review of dependabot PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Script to facilitate batched review of dependabot PRs | |
| # Change these values | |
| TITLE="actions/download-artifact" | |
| COMMENT="Breaking change is an error instead of warning for hash mismatch. 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 "# $repo" | |
| echo "" | |
| echo "$url" | |
| echo "" | |
| echo "Checks:" | |
| echo "" | |
| gh pr checks $pr_number --repo $repo --json "state" --jq ".[].state" | sort | uniq -c | |
| echo "" | |
| echo "handy commands:" | |
| echo "" | |
| echo '```' | |
| 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