mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Handle shallow clones in merge_open_prs.sh
Add logic to handle shallow repositories in merge script
This commit is contained in:
@@ -10,6 +10,12 @@ if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If this is a shallow clone, fetch enough history to compute merge bases
|
||||
if git rev-parse --is-shallow-repository >/dev/null 2>&1 && git rev-parse --is-shallow-repository | grep -q true; then
|
||||
echo "🔄 Repository is shallow; fetching full history to enable merging…"
|
||||
git fetch --unshallow || git fetch --deepen=100000
|
||||
fi
|
||||
|
||||
# Get list of open, non-draft PR numbers via GitHub API
|
||||
echo "🔍 Fetching open PRs..."
|
||||
mapfile -t PRS < <(curl -s "https://api.github.com/repos/alexbelgium/BirdNET-Pi/pulls?state=open&per_page=100" \
|
||||
|
||||
Reference in New Issue
Block a user