Fix manual builds for branches other than master

I wasn't building the ref right for branches when getting the SHA. It just happened to work for master when I tested because there was a local master. 

(There is refactoring that still needs to be done, and some DRYing up, but I want to get this fixed ASAP for https://github.com/octokit/octokit.net/pull/241.)