Skip to content

Instantly share code, notes, and snippets.

@odyssey4me
Created October 16, 2017 12:43
Show Gist options
  • Save odyssey4me/7d1f7de027e727a2d9dd76b19806ae46 to your computer and use it in GitHub Desktop.
Save odyssey4me/7d1f7de027e727a2d9dd76b19806ae46 to your computer and use it in GitHub Desktop.
Update the status for a github PR
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