Skip to content

Commit

Permalink
Fix issue when local branch already exists (actions/checkout@v2 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Dec 17, 2020
1 parent 63ff174 commit 3ac068c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ git config --global user.email "$INPUT_USER_EMAIL"

set -o xtrace

git fetch origin $INPUT_STABLE_BRANCH
git checkout -b $INPUT_STABLE_BRANCH origin/$INPUT_STABLE_BRANCH

git fetch origin $INPUT_DEVELOPMENT_BRANCH
git checkout -b $INPUT_DEVELOPMENT_BRANCH origin/$INPUT_DEVELOPMENT_BRANCH
git checkout $INPUT_STABLE_BRANCH || git fetch origin $INPUT_STABLE_BRANCH && git checkout -b $INPUT_STABLE_BRANCH origin/$INPUT_STABLE_BRANCH
git checkout $INPUT_DEVELOPMENT_BRANCH || git fetch origin $INPUT_DEVELOPMENT_BRANCH && git checkout -b $INPUT_DEVELOPMENT_BRANCH origin/$INPUT_DEVELOPMENT_BRANCH

if git merge-base --is-ancestor $INPUT_STABLE_BRANCH $INPUT_DEVELOPMENT_BRANCH; then
echo "No merge is necessary"
Expand Down

0 comments on commit 3ac068c

Please sign in to comment.