show PRs on check_run output where possible
This commit is contained in:
parent
c4c6fdde1c
commit
a91c03421f
1 changed files with 8 additions and 2 deletions
|
@ -441,6 +441,12 @@ class GitHub(object):
|
||||||
commit = self._short_hash(data["check_run"]["head_sha"])
|
commit = self._short_hash(data["check_run"]["head_sha"])
|
||||||
commit = utils.irc.color(commit, utils.consts.LIGHTBLUE)
|
commit = utils.irc.color(commit, utils.consts.LIGHTBLUE)
|
||||||
|
|
||||||
|
pr = ""
|
||||||
|
if ("pull_requests" in data["check_run"] and
|
||||||
|
data["check_run"]["pull_requests"]):
|
||||||
|
pr_num = data["check_run"]["pull_requests"][0]["number"]
|
||||||
|
pr = "/PR%s" % utils.irc.color("#%s" % pr_num, colors.COLOR_ID)
|
||||||
|
|
||||||
url = ""
|
url = ""
|
||||||
if data["check_run"]["details_url"]:
|
if data["check_run"]["details_url"]:
|
||||||
url = data["check_run"]["details_url"]
|
url = data["check_run"]["details_url"]
|
||||||
|
@ -472,8 +478,8 @@ class GitHub(object):
|
||||||
status_str = utils.irc.color(
|
status_str = utils.irc.color(
|
||||||
CHECK_RUN_CONCLUSION[conclusion], conclusion_color)
|
CHECK_RUN_CONCLUSION[conclusion], conclusion_color)
|
||||||
|
|
||||||
return ["[build @%s] %s: %s%s%s" % (
|
return ["[build @%s%s] %s: %s%s%s" % (
|
||||||
commit, name, status_str, duration, url)]
|
commit, pr, name, status_str, duration, url)]
|
||||||
|
|
||||||
def fork(self, full_name, data):
|
def fork(self, full_name, data):
|
||||||
forker = utils.irc.bold(data["sender"]["login"])
|
forker = utils.irc.bold(data["sender"]["login"])
|
||||||
|
|
Loading…
Reference in a new issue