Skip to content

Commit d841859

Browse files
committed
ci: Revert-back to original branch after sync_branches
So next steps are in the correct branch. Signed-off-by: Jorge Marques <[email protected]>
1 parent 0431b7e commit d841859

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ci/maintenance.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
sync_branches () {
22
local fail_
33
local fail=0
4+
local initial_branch=
45

56
echo "sync_branches_with_main on range $base_sha..$head_sha"
67

@@ -9,6 +10,7 @@ sync_branches () {
910
set_step_fail "sync_branches"
1011
return
1112
fi
13+
initial_branch=$(git rev-parse --abbrev-ref @)
1214
for branch in $@ ; do
1315
echo "patching branch $branch"
1416
git switch -d
@@ -35,6 +37,7 @@ sync_branches () {
3537
fi
3638
git push origin HEAD:$branch
3739
done
40+
git switch $initial_branch
3841

3942
if [[ "$fail" == "1" ]]; then
4043
set_step_fail "sync_branches"

0 commit comments

Comments
 (0)