Method: Janky::GitHub.branch_head_sha
- Defined in:
- lib/janky/github.rb
.branch_head_sha(nwo, branch) ⇒ Object
Fetch the SHA1 of the given branch HEAD.
nwo - qualified “owner/repo” name. branch - Name of the branch as a String.
Returns the SHA1 as a String or nil when the branch doesn’t exists.
69 70 71 72 73 74 |
# File 'lib/janky/github.rb', line 69 def self.branch_head_sha(nwo, branch) response = api.branch(nwo, branch) branch = Yajl.load(response.body) branch && branch["sha"] end |