Created
March 1, 2013 17:45
-
-
Save justincampbell/5066394 to your computer and use it in GitHub Desktop.
Jenkins + GitHub Commit Status API
This file contains 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
if [[ $BUILD_STATUS == "success" ]] | |
then | |
export STATUS="success" | |
else | |
export STATUS="failure" | |
fi | |
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \ | |
-H "Content-Type: application/json" \ | |
-X POST \ | |
-d "{\"state\": \"$STATUS\", \"description\": \"Jenkins\", \"target_url\": \"http://my.jenkins.box.com/job/dividata/$BUILD_NUMBER/console\"}" |
This file contains 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
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \ | |
-H "Content-Type: application/json" \ | |
-X POST \ | |
-d "{\"state\": \"pending\", \"description\": \"Jenkins\", \"target_url\": \"http://my.jenkins.box.com/job/dividata/$BUILD_NUMBER/console\"}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note upcoming (November 13, 2020 at 4:00 PM UTC) deprecation of API authentication using query parameters
https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/
Future users of this info will want to make following modifications to this gist: