This repository was archived by the owner on Feb 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ before_install:
1212 - composer install
1313 - composer require --prefer-source --dev squizlabs/php_codesniffer:~2.0
1414 - composer create-project --prefer-source -s dev --no-interaction cakephp/app tests/test_app
15+ - source tests/travis-github-pr-integration.sh
1516 - cp tests/Fixture/composer.json tests/test_app/.
1617 - cd tests/test_app
1718 - composer require --prefer-source --dev cakephp/codeception:dev-$TRAVIS_BRANCH#$TRAVIS_COMMIT
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Return if we are not in a Pull Request
4+ [[ " $TRAVIS_PULL_REQUEST " = " false" ]] && return
5+
6+ GITHUB_PR_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG /pulls/$TRAVIS_PULL_REQUEST
7+ GITHUB_PR_BODY=$( curl -s $GITHUB_PR_URL 2> /dev/null)
8+
9+ if [[ $GITHUB_PR_BODY =~ \" ref\" :\ * \" ([a-zA-Z0-9_-]* )\" ]]; then
10+ export TRAVIS_PR_BRANCH=${BASH_REMATCH[1]}
11+ else
12+ return
13+ fi
14+
15+ GITHUB_BRANCH_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG /branches/$TRAVIS_PR_BRANCH
16+ if [ $( curl -s --head --request GET $GITHUB_BRANCH_URL | grep " 200 OK" > /dev/null) ]; then
17+ TRAVIS_BRANCH=$TRAVIS_PR_BRANCH
18+ if [[ $GITHUB_PR_BODY =~ \" repo\" :.* \" clone_url\" :\ * \" https://github\. com/([a-zA-Z0-9_-]* /[a-zA-Z0-9_-]* )\. git.* \" base\" ]]; then
19+ export TRAVIS_REPO_SLUG=${BASH_REMATCH[1]}
20+ fi
21+ fi
You can’t perform that action at this time.
0 commit comments