Created
October 16, 2017 12:43
-
-
Save odyssey4me/7d1f7de027e727a2d9dd76b19806ae46 to your computer and use it in GitHub Desktop.
Update the status for a github PR
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
update_gh_status(){ | |
sha="$1" | |
state="$2" | |
description="$3" | |
context="$4" | |
owner="${5:-rcbops}" | |
repo="${6:-rpc-openstack}" | |
oauth_token="${7:-YOUR_PAT}" | |
if [[ ${#@} < 4 ]]; then | |
echo "Usage: update_gh_status sha state description context [owner, repo, oauth_token]" | |
return 1 | |
fi | |
curl https://api.github.com/repos/$owner/$repo/statuses/${sha}?access_token=${oauth_token} \ | |
-d '{"state": "'$state'", "target_url": "https://ninja.merge", "description": "'$description'", "context": "'$context'"}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment