Skip to content

Instantly share code, notes, and snippets.

@SergioEstevao
Created January 21, 2015 23:47
Show Gist options
  • Save SergioEstevao/67be064cc9554437a53a to your computer and use it in GitHub Desktop.
Save SergioEstevao/67be064cc9554437a53a to your computer and use it in GitHub Desktop.
Sending message to github
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