From a652a7e56438ff3a7db41c7ef82a693d31f041b2 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 26 Mar 2014 13:37:51 -0600 Subject: [PATCH] Only post comment if this is a pull request --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fadcf76..34155ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,9 +20,11 @@ after_script: - make -j2 - popd - ../cppcheck-1.64/cppcheck --enable=all --inconclusive -I include --inline-suppr --std=c++11 --platform=unix64 src/main.cpp src/chai*.cpp --template ' - __{severity}__: [{file}:{line}](../blob/TRAVIS_COMMIT/{file}#L{line}) {message} ({id})' 2>output -- sed -i "s/TRAVIS_COMMIT/${TRAVIS_COMMIT}/g" output && echo -n '{ "body": " ' > output.json -- echo -n `awk '{printf "%s\\\\n", $0;}' output` >> output.json && echo -n '"}' >> output.json -- curl -H "Authorization: token ${TOKEN}" --request POST --data @output.json https://api.github.com/repos/ChaiScript/ChaiScript/commits/${TRAVIS_COMMIT}/comments +- sed -i "s/TRAVIS_COMMIT/${TRAVIS_COMMIT}/g" output +- echo -n '{ "body": " ' > output.json +- echo -n `awk '{printf "%s\\\\n", $0;}' output` >> output.json +- echo -n '"}' >> output.json +- if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then curl -H "Authorization: token ${TOKEN}" --request POST --data @output.json https://api.github.com/repos/ChaiScript/ChaiScript/commits/${TRAVIS_COMMIT}/comments; fi notifications: recipients: - jason@emptycrate.com