Skip to content

Commit 9cff8ff

Browse files
author
Matthias Koeppe
committed
.ci/merge-fixes.sh: New
1 parent 4ba2b6a commit 9cff8ff

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.ci/merge-fixes.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
# Merge open PRs from sagemath/sage labeled "blocker".
3+
GH="gh -R sagemath/sage"
4+
PRs="$($GH pr list --label "p: blocker / 1" --json number --jq '.[].number')"
5+
if [ -z "$PRs" ]; then
6+
echo 'Nothing to do: Found no open PRs with "blocker" status.'
7+
else
8+
echo "Found PRs: " $PRs
9+
export GIT_AUTHOR_NAME="ci-sage workflow"
10+
export GIT_AUTHOR_EMAIL="[email protected]"
11+
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
12+
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
13+
git commit -q -m "Uncommitted changes" --no-allow-empty -a
14+
git tag -f test_head
15+
for a in $PRs; do
16+
echo "::group::Merging PR #$a"
17+
$GH pr checkout $a
18+
git checkout -q test_head
19+
if git merge --no-edit -q FETCH_HEAD; then
20+
echo "::endgroup::"
21+
echo "Merged #$a"
22+
else
23+
echo "::endgroup::"
24+
echo "Failure merging #$a, resetting"
25+
git reset --hard
26+
fi
27+
done
28+
fi

0 commit comments

Comments
 (0)