[ci] consider forked builds as pull requests

forked builds are travis builds on forked repos
This commit is contained in:
Andreas Dangel
2017-10-08 09:43:56 +02:00
parent 61376f8112
commit f13ba86f9c
2 changed files with 4 additions and 6 deletions

View File

@ -11,9 +11,8 @@ echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "TRAVIS_TAG: $TRAVIS_TAG"
echo "TRAVIS_ALLOW_FAILURE: $TRAVIS_ALLOW_FAILURE"
function travis_isPullRequest() {
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ "${TRAVIS_REPO_SLUG}" != "pmd/pmd" ] || [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
return 0
else
return 1
@ -21,7 +20,7 @@ function travis_isPullRequest() {
}
function travis_isPush() {
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ]; then
if [ "${TRAVIS_REPO_SLUG}" = "pmd/pmd" && "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ]; then
return 0
else
return 1

View File

@ -1,12 +1,11 @@
#!/bin/bash
set -e
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ "${TRAVIS_SECURE_ENV_VARS}" != "true" ]; then
echo "Not setting up secrets (TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} TRAVIS_SECURE_ENV_VARS=${TRAVIS_SECURE_ENV_VARS})."
if [ "$TRAVIS_REPO_SLUG" != "pmd/pmd" ] || [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ "${TRAVIS_SECURE_ENV_VARS}" != "true" ]; then
echo "Not setting up secrets (TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG} TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} TRAVIS_SECURE_ENV_VARS=${TRAVIS_SECURE_ENV_VARS})."
exit 0
fi
openssl aes-256-cbc -K $encrypted_5630fbebf057_key -iv $encrypted_5630fbebf057_iv -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
pushd .travis && tar xfv secrets.tar && popd
mkdir -p "$HOME/.ssh"