aboutsummaryrefslogtreecommitdiff
path: root/modules/github.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-26 11:25:28 +0100
committerGravatar jesopo2018-10-26 11:25:28 +0100
commite9ed153aa3644b6ace759ea469d26bfb279a597e (patch)
tree2474140397aa9d8fd3506576d807efc83afbe82e /modules/github.py
parentsignal.signal timer callback takes 2 args (diff)
signature
Put commit urls on github webhook notices in modules/github.py
Diffstat (limited to 'modules/github.py')
-rw-r--r--modules/github.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/github.py b/modules/github.py
index 20209c29..c3d9fbaf 100644
--- a/modules/github.py
+++ b/modules/github.py
@@ -1,6 +1,8 @@
import json
from src import ModuleManager, utils
+COMMIT_URL = "https://github.com/%s/commit/%s"
+
@utils.export("channelset", {"setting": "github-hook",
"help": ("Disable/Enable showing BitBot's github commits in the "
"current channel"), "validate": utils.bool_or_none,
@@ -30,10 +32,11 @@ class Module(ModuleManager.BaseModule):
modified_count = len(commit["modified"])
added_count = len(commit["added"])
removed_count = len(commit["removed"])
+ url = COMMIT_URL % (full_name, id[:8])
- line = ("(%s) [files: +%d ∆%d -%d] commit by '%s': %s"
+ line = ("(%s) [files: +%d ∆%d -%d] commit by '%s': %s %s"
% (full_name, added_count, modified_count,
- removed_count, author, message))
+ removed_count, author, message, url))
hooks = [hook for hook in hooks if hook[2]]
for server_id, channel_name, _ in hooks:
server = self.bot.get_server(server_id)