-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b06ed1
commit f035017
Showing
2 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,4 @@ jobs: | |
git remote set-url origin https://x-access-token:[email protected]/xing/hops.git | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Action" | ||
git fetch origin master | ||
git fetch origin next | ||
git checkout -b next origin/next | ||
git rebase origin/master || test "$(git diff --name-only --diff-filter=U)" = "yarn.lock" && yarn && git add yarn.lock && git rebase --continue | ||
git push --force-with-lease | ||
./scripts/rebase.sh master next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
base_brach=${1:-master} | ||
head_branch=${2:-next} | ||
|
||
git fetch origin "$base_brach" | ||
git fetch origin "$head_branch" | ||
git checkout -b "$head_branch" "origin/$head_branch" | ||
|
||
is_rebasing=1 | ||
|
||
exitcode=0 && git rebase "origin/$base_brach" || exitcode=$? | ||
if [[ $exitcode -eq 0 ]]; then is_rebasing=0; fi | ||
|
||
while [[ $is_rebasing == 1 ]]; do | ||
if [[ "$(git diff --name-only --diff-filter=U)" == "yarn.lock" ]]; then | ||
yarn install | ||
git add yarn.lock | ||
exitcode=0 && git rebase --continue || exitcode=$? | ||
if [[ $exitcode -eq 0 ]]; then | ||
is_rebasing=0 | ||
break | ||
fi | ||
else | ||
break | ||
fi | ||
done | ||
|
||
if [[ $is_rebasing -eq 0 ]]; then | ||
git push "$base_brach" "$head_branch" --force-with-lease | ||
else | ||
exit $exitcode | ||
fi |