Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d93c140

Browse files
committed
Fix Circle merge on master branch.
There exists a PR on a random fork, which fills in `CI_PULL_REQUEST`, which we don't want to use as merge target when building `master`. Instead, check `CIRCLE_PR_NUMBER`, which is set only on forked PRs. Also, check branch name (which is current, not the _target_) to be certain.
1 parent dea6221 commit d93c140

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ commands:
3131
git remote add upstream git://github.com/matplotlib/matplotlib.git
3232
fi
3333
git fetch upstream
34-
export merge=${CI_PULL_REQUEST//*pull\//}
35-
if [[ "$merge" != "" ]]; then
36-
echo "Merging ${merge}";
37-
git pull --ff-only upstream "refs/pull/${merge}/merge";
34+
if [[ "$CIRCLE_BRANCH" != "master" ]] && \
35+
[[ "$CIRCLE_PR_NUMBER" != "" ]]; then
36+
echo "Merging ${CIRCLE_PR_NUMBER}"
37+
git pull --ff-only upstream "refs/pull/${CIRCLE_PR_NUMBER}/merge"
3838
fi
3939
4040
apt-install:

0 commit comments

Comments
 (0)