aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2019-07-24 13:46:24 -0400
committerGitHub <noreply@github.com>2019-07-24 13:46:24 -0400
commit0ed750a7ea92cd0dde949daed06b5a60cab25f9f (patch)
tree845434df8a87590e4bf482201f1f2e819fcd6822 /test
parent1ac79b2558cfa630157ddfa96f25bbad4b7cdffc (diff)
parent7feae084b1be7f4fee424bfa4a76631ec1af37de (diff)
downloadjansson-0ed750a7ea92cd0dde949daed06b5a60cab25f9f.zip
jansson-0ed750a7ea92cd0dde949daed06b5a60cab25f9f.tar.gz
jansson-0ed750a7ea92cd0dde949daed06b5a60cab25f9f.tar.bz2
Merge pull request #486 from cmeister2/cmeister2/osstravis
Ensure OSS fuzz travis builds work for PRs
Diffstat (limited to 'test')
-rwxr-xr-xtest/ossfuzz/travisoss.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/ossfuzz/travisoss.sh b/test/ossfuzz/travisoss.sh
index e99cc6e..ddcfa07 100755
--- a/test/ossfuzz/travisoss.sh
+++ b/test/ossfuzz/travisoss.sh
@@ -16,8 +16,20 @@ then
exit 0
fi
+# Work out which repo to clone from, inside Docker
+if [[ ${TRAVIS_PULL_REQUEST} != "false" ]]
+then
+ # Pull-request branch
+ REPO=${TRAVIS_PULL_REQUEST_SLUG}
+ BRANCH=${TRAVIS_PULL_REQUEST_BRANCH}
+else
+ # Push build.
+ REPO=${TRAVIS_REPO_SLUG}
+ BRANCH=${TRAVIS_BRANCH}
+fi
+
# Modify the oss-fuzz Dockerfile so that we're checking out the current branch on travis.
-sed -i "s@https://github.com/akheron/jansson.git@-b $TRAVIS_BRANCH https://github.com/akheron/jansson.git@" /tmp/ossfuzz/projects/${PROJECT_NAME}/Dockerfile
+sed -i "s@https://github.com/akheron/jansson.git@-b ${BRANCH} https://github.com/${REPO}.git@" /tmp/ossfuzz/projects/${PROJECT_NAME}/Dockerfile
# Try and build the fuzzers
pushd /tmp/ossfuzz