Skip to content

Commit 2b48241

Browse files
committed
fixup! 🚀 Rebase to mergebase fork-point instead of 'master' or 'develop'
1 parent 3dac019 commit 2b48241

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.circleci/config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,15 @@ jobs:
143143
if ! [[ $CIRCLE_BRANCH = 'master' ]]
144144
then
145145
git fetch --all
146-
REBASE_BASE=$(git merge-base --fork-point HEAD)
147-
GIT_SEQUENCE_EDITOR=dev/circleci_data/drop_version_bump_commits git rebase -X ours -i $REBASE_BASE --empty drop
146+
if [[ -n ${CIRCLE_PR_NUMBER} && -n ${GITHUB_PR_BASE_TOKEN} ]]
147+
then
148+
curl -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -o jq
149+
chmod +x jq
150+
REBASE_BASE=origin/$(curl -u shnizzedy:$GITHUB_PR_BASE_TOKEN "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER" | jq '.base.ref' | tr -d '"')
151+
else
152+
REBASE_BASE=$(git rev-parse --short HEAD~30)
153+
fi
154+
GIT_SEQUENCE_EDITOR=dev/circleci_data/drop_version_bump_commits git rebase -X ours -i $REBASE_BASE --empty drop
148155
fi
149156
echo "v${VERSION}" > version
150157
sed -i -r "s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" dev/docker_data/default_pipeline.yml

0 commit comments

Comments
 (0)