зеркало из https://github.com/mozilla/treeherder.git
Bug 1514412 - Fix KeyError in tag push situation of GithubPushTransformer (#6216)
* fix: KeyError when GithubPushTransformer.get_branch's called when tag push triggers * chore: remove unused whitespace
This commit is contained in:
Родитель
53a806d3cc
Коммит
e9298f7be4
|
@ -160,6 +160,15 @@ class GithubPushTransformer(GithubTransformer):
|
|||
|
||||
URL_BASE = "https://api.github.com/repos/{}/{}/compare/{}...{}"
|
||||
|
||||
def get_branch(self):
|
||||
"""
|
||||
Tag pushes don't use the actual branch, just the string "tag"
|
||||
"""
|
||||
if self.message_body["details"].get("event.head.tag"):
|
||||
return "tag"
|
||||
|
||||
return super(GithubPushTransformer, self).get_branch()
|
||||
|
||||
def transform(self, repository):
|
||||
push_url = self.URL_BASE.format(
|
||||
self.message_body["organization"],
|
||||
|
|
Загрузка…
Ссылка в новой задаче