Created
June 5, 2025 16:11
-
-
Save ange-daumal/1e423b377f142752cd1482122b90fe56 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Define target repositories | |
REPOS=("algolia/python" "algolia/go") | |
echo "🔍 Listing open PRs with review requested for you or your team..." | |
for REPO in "${REPOS[@]}"; do | |
echo -e "\n📦 Repository: $REPO" | |
# Get PR numbers, titles, and URLs | |
gh pr list \ | |
--repo "$REPO" \ | |
--state open \ | |
--search "review-requested:@me" \ | |
--json number,title,url \ | |
--jq '.[] | [.number, .title, .url] | @tsv' | | |
while IFS=$'\t' read -r number title url; do | |
# Exclude PRs starting with "chore(deps):" | |
if [[ "$title" =~ ^chore\(deps\): ]]; then | |
continue | |
fi | |
# Check if it's a draft | |
is_draft=$(gh pr view "$number" --repo "$REPO" --json isDraft --jq '.isDraft') | |
# Display accordingly | |
if [[ "$is_draft" == "true" ]]; then | |
echo "[DRAFT] $title → $url" | |
else | |
echo "$title → $url" | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment