Commit 96a65e0 1 parent 87ec66b commit 96a65e0 Copy full SHA for 96a65e0
File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
all_pr_branches=(" update-cypress-dependencies-and-containers" " update-gradle" " update-npm-dependencies" )
4
4
remote_name=" origin"
5
-
6
5
cd ..
7
6
for item in * ; do
8
7
if [[ -d " $item " ]]; then
9
8
cd " ${item} " || exit
10
9
if [ -f Makefile ]; then
11
10
if grep -q " ^accept-prs:" Makefile; then
12
11
echo " ---*** Accept PR Makefile command found in $item ***---"
12
+ if git ls-remote --exit-code --heads " $remote_name " " master" ; then
13
+ master_branch=" master"
14
+ fi
15
+ if git ls-remote --exit-code --heads " $remote_name " " main" ; then
16
+ master_branch=" main"
17
+ fi
18
+ if [ -n " ${master_branch} " ]; then
19
+ git checkout " ${master_branch} "
20
+ fi
13
21
git pull
14
22
git fetch -p
15
23
for branch_name in " ${all_pr_branches[@]} " ; do
16
24
if git ls-remote --exit-code --heads " $remote_name " " $branch_name " ; then
17
25
echo " Remote branch '$branch_name ' exists on '$remote_name '."
18
26
make accept-prs
27
+ if [ -n " ${master_branch} " ]; then
28
+ git checkout " ${branch_name} "
29
+ git merge origin/" ${master_branch} " --no-edit
30
+ git push
31
+ gh pr merge $( gh pr list --base " ${master_branch} " --head " ${branch_name} " --json number --jq ' .[0].number' | xargs echo) --auto --merge
32
+ git checkout " ${master_branch} "
33
+ fi
19
34
fi
20
35
done
21
36
fi
You can’t perform that action at this time.
0 commit comments