Add scripts/find_git_conflicts.sh (#12343)

This commit is contained in:
Christian Clauss 2024-11-01 13:40:09 +01:00 committed by GitHub
parent 52602ea5b6
commit a19bede190
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

16
scripts/find_git_conflicts.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Replace with your repository (format: owner/repo)
REPO="TheAlgorithms/Python"
# Fetch open pull requests with conflicts into a variable
echo "Checking for pull requests with conflicts in $REPO..."
prs=$(gh pr list --repo "$REPO" --state open --json number,title,mergeable --jq '.[] | select(.mergeable == "CONFLICTING") | {number, title}' --limit 500)
# Process each conflicting PR
echo "$prs" | jq -c '.[]' | while read -r pr; do
PR_NUMBER=$(echo "$pr" | jq -r '.number')
PR_TITLE=$(echo "$pr" | jq -r '.title')
echo "PR #$PR_NUMBER - $PR_TITLE has conflicts."
done