#!/usr/bin/env bash

if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
    curl -s "https://api.travis-ci.org/repos/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}" | jq '.message' | sed 's/\\n.*//'
else
    export PULL_REQUEST_TITLE=$(curl -s "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/pulls/${TRAVIS_PULL_REQUEST}" | jq '.title' | sed 's/"//g')
    echo "PR #${TRAVIS_PULL_REQUEST}: ${PULL_REQUEST_TITLE}"
fi


#!/usr/bin/env bash

if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
    echo "TODO"
else
    export PULL_REQUEST_TITLE=$(curl -s "https://api.github.com/repos/ORNL-CEES/Cap/pulls/${TRAVIS_PULL_REQUEST}" | jq '.title' | sed 's/"//g')
    echo "Pull Request #${TRAVIS_PULL_REQUEST}: ${PULL_REQUEST_TITLE}"
fi


--- 
+++ 
@@ -1,9 +1,9 @@
 #!/usr/bin/env bash
 
 if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
-    echo "TODO"
+    curl -s "https://api.travis-ci.org/repos/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}" | jq '.message' | sed 's/\\n.*//'
 else
-    export PULL_REQUEST_TITLE=$(curl -s "https://api.github.com/repos/ORNL-CEES/Cap/pulls/${TRAVIS_PULL_REQUEST}" | jq '.title' | sed 's/"//g')
-    echo "Pull Request #${TRAVIS_PULL_REQUEST}: ${PULL_REQUEST_TITLE}"
+    export PULL_REQUEST_TITLE=$(curl -s "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/pulls/${TRAVIS_PULL_REQUEST}" | jq '.title' | sed 's/"//g')
+    echo "PR #${TRAVIS_PULL_REQUEST}: ${PULL_REQUEST_TITLE}"
 fi
 
Improve build info on CDash
