Skip to content

Instantly share code, notes, and snippets.

@meatballhat
Created March 12, 2014 17:14
Show Gist options
  • Select an option

  • Save meatballhat/9511651 to your computer and use it in GitHub Desktop.

Select an option

Save meatballhat/9511651 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -z "$GITHUB_AUTH_TOKEN" ]] ; then
echo 'ERROR: $GITHUB_AUTH_TOKEN must be set'
exit 1
fi
if [[ $# < 2 ]] ; then
echo "Usage: $(basename $0) <owner/repo> <sha1>"
exit 1
fi
OWNER_REPO="$1"
SHA="$2"
exec curl \
-d '{
"state": "success",
"target_url": "http://www.example.com/rofl",
"description": "Green, you hosers!"
}' \
-H 'Content-Type: application/json' \
-H "Authorization: token $GITHUB_AUTH_TOKEN" \
"https://api.github.com/repos/${OWNER_REPO}/statuses/${SHA}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment