Created
January 21, 2015 23:47
-
-
Save SergioEstevao/67be064cc9554437a53a to your computer and use it in GitHub Desktop.
Sending message to github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sha=`echo $TRAVIS_COMMIT_RANGE | cut -d '.' -f 4` | |
full_sha=`git rev-parse $sha` | |
travis_url="https://travis-ci.org/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}/" | |
if [[ $errors -eq 0 ]]; then | |
state="success" | |
message="OCLinted OK!" | |
else | |
state="failure" | |
message="OCLint detected new issues!" | |
fi | |
curl -i -H "Content-Type: application/json" \ | |
-H "Authorization: token ${TRAVIS_OCLINT_GITHUB_TOKEN}" \ | |
-d "{\"state\": \"${state}\",\"target_url\": \"${travis_url}\",\"description\": \"${message}\",\"context\": \"continuous-integration/oclint\"}" \ | |
https://api.github.com/repos/${TRAVIS_REPO_SLUG}/statuses/$full_sha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment