Ross's Musings‎ > ‎

Github API again - still useful

posted Oct 8, 2014, 2:14 PM by Ross Reedstrom   [ updated Oct 15, 2014, 2:56 PM ]
Like much of the rest of the open source developing world, we use to host all of our open source code. We've decided that code-review via github Pull Request (PR) works well for our team, using the typical feature-branch, 2nd party merge PR workflow. However, I find it to be a bit of a speed bump for very small, direct bug fixes. In other projects, "senior developers" would tend to just fix those directly on master, but for the culture on this project, that just feels wrong. The process of creating a special purpose branch, committing to it, and pushing it upstream is easy enough. It's only the last step, creating tha actual PR, that requires switching focus to a web browser, finding the right page, typing in the description, and then creating the PR.

Github API to the rescue.

echo '{"title":"Descriptive title for changes","body":"More explanation","head":"feature-branch-name","base":"master"}' | \
curl --data-binary @- -u $GITCREDS

(github response with a hug number of lines of json)

o.k. that's not going to roll off my fingertips as simply as 'git push origin', but I think we can wrap it in suitable clothing, in a small bash script. That's for another day, however.