Fix Github Trigger handling when there is no committer
This commit is contained in:
parent
699cb9a5da
commit
56be893d7e
1 changed files with 13 additions and 7 deletions
|
@ -318,22 +318,28 @@ class GithubBuildTrigger(BuildTrigger):
|
||||||
logger.exception('Could not load data for commit')
|
logger.exception('Could not load data for commit')
|
||||||
return
|
return
|
||||||
|
|
||||||
return {
|
commit_info = {
|
||||||
'url': commit.html_url,
|
'url': commit.html_url,
|
||||||
'message': commit.commit.message,
|
'message': commit.commit.message,
|
||||||
'author': {
|
'date': commit.last_modified
|
||||||
|
}
|
||||||
|
|
||||||
|
if commit.author:
|
||||||
|
commit_info['author'] = {
|
||||||
'username': commit.author.login,
|
'username': commit.author.login,
|
||||||
'avatar_url': commit.author.avatar_url,
|
'avatar_url': commit.author.avatar_url,
|
||||||
'url': commit.author.html_url
|
'url': commit.author.html_url
|
||||||
},
|
}
|
||||||
'committer': {
|
|
||||||
|
if commit.committer:
|
||||||
|
commit_info['committer'] = {
|
||||||
'username': commit.committer.login,
|
'username': commit.committer.login,
|
||||||
'avatar_url': commit.committer.avatar_url,
|
'avatar_url': commit.committer.avatar_url,
|
||||||
'url': commit.committer.html_url
|
'url': commit.committer.html_url
|
||||||
},
|
|
||||||
'date': commit.last_modified
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return commit_info
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _prepare_build(config, repo, commit_sha, build_name, ref):
|
def _prepare_build(config, repo, commit_sha, build_name, ref):
|
||||||
# Prepare the download and upload URLs
|
# Prepare the download and upload URLs
|
||||||
|
|
Reference in a new issue