Skip to content

Commit

Permalink
.ci/merge-fixes.sh: Unshallow for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Sep 26, 2023
1 parent a9d84a8 commit e4025c1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .ci/merge-fixes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
# Merge open PRs from sagemath/sage labeled "blocker".
GH="gh -R sagemath/sage"
REPO="sagemath/sage"
GH="gh -R $REPO"
PRs="$($GH pr list --label "p: blocker / 1" --json number --jq '.[].number')"
if [ -z "$PRs" ]; then
echo 'Nothing to do: Found no open PRs with "blocker" status.'
Expand All @@ -11,12 +12,13 @@ else
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
git commit -q -m "Uncommitted changes" --no-allow-empty -a
git tag -f test_head
for a in $PRs; do
echo "::group::Merging PR #$a"
$GH pr checkout $a
echo "::group::Merging PR https://github.com/$REPO/pull/$a"
git tag -f test_head
$GH pr checkout -b pr-$a $a
git fetch --unshallow --all
git checkout -q test_head
if git merge --no-edit -q FETCH_HEAD; then
if git merge --no-edit -q pr-$a; then
echo "::endgroup::"
echo "Merged #$a"
else
Expand All @@ -25,4 +27,5 @@ else
git reset --hard
fi
done
git log test_head..HEAD
fi

0 comments on commit e4025c1

Please sign in to comment.