def repo_sha_from_github(repo, branch=u'master'):
"""
Get sha from head of given repo
:param repo: Path to repo (owner/repo_name)
:param branch: Name of branch to get sha for
:returns: Sha of branch
"""
url = 'repos/%s/git/refs/heads/%s' % (repo, branch)
app.logger.debug('GET: %s', url)
resp = github.get(url)
if resp.status != 200:
log_error('Failed reading sha', url, resp, branch=branch)
return None
return resp.data['object']['sha']
评论列表
文章目录