File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,17 @@ common: &common
66 working_directory : ~/repo
77 steps :
88 - checkout
9+ - run :
10+ name : merge pull request base
11+ command : ./.circleci/merge_pr.sh
12+ - run :
13+ name : merge pull request base (2nd try)
14+ command : ./.circleci/merge_pr.sh
15+ when : on_fail
16+ - run :
17+ name : merge pull request base (3nd try)
18+ command : ./.circleci/merge_pr.sh
19+ when : on_fail
920 - run :
1021 name : merge pull request base
1122 command : |
@@ -33,6 +44,7 @@ common: &common
3344 command : ~/.local/bin/tox -r
3445 - save_cache :
3546 paths :
47+ - .hypothesis
3648 - .tox
3749 - ~/.cache/pip
3850 - ~/.local
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ if [[ -n " ${CIRCLE_PR_NUMBER} " ]]; then
4+ PR_INFO_URL=https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME /$CIRCLE_PROJECT_REPONAME /pulls/$CIRCLE_PR_NUMBER
5+ PR_BASE_BRANCH=$( curl -L " $PR_INFO_URL " | python -c ' import json, sys; obj = json.load(sys.stdin); sys.stdout.write(obj["base"]["ref"])' )
6+ git fetch origin +" $PR_BASE_BRANCH " :circleci/pr-base
7+ # We need these config values or git complains when creating the
8+ # merge commit
9+ git config --global user.name " Circle CI"
10+ git config --global user.email " circleci@example.com"
11+ git merge --no-edit circleci/pr-base
12+ fi
You can’t perform that action at this time.
0 commit comments