Skip to content

Commit

Permalink
Debugging rebase failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Jan 3, 2024
1 parent f2fd3c9 commit cc49a4e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/scripts/rebase-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ UPSTREAM_URL=$1
UPSTREAM_BRANCH=$2
REBASE_BRANCH=$3

git config pull.rebase true
git config user.name github-actions
git config user.email [email protected]

# Add and update upstream remote.
if ! git remote | grep upstream; then
git remote add upstream $UPSTREAM_URL
Expand All @@ -15,15 +19,14 @@ git fetch --all --prune

# Checkout or create $REBASE_BRANCH.
if git show-ref --verify --quiet refs/remotes/origin/$REBASE_BRANCH; then
echo "Resetting $REBASE_BRANCH branch to origin/$REBASE_BRANCH branch."
git switch $REBASE_BRANCH
git pull origin $REBASE_BRANCH
git reset --hard origin/$REBASE_BRANCH
else
echo "Creating $REBASE_BRANCH branch from $UPSTREAM_BRANCH branch."
git switch -c $REBASE_BRANCH
fi

git config user.name github-actions
git config user.email [email protected]

# Create upstream branch from upstream/$UPSTREAM_BRANCH.
git branch upstream upstream/$UPSTREAM_BRANCH
git push --set-upstream origin upstream
Expand Down

0 comments on commit cc49a4e

Please sign in to comment.