aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-17 20:48:19 +0000
committerGravatar jesopo2018-11-17 20:48:19 +0000
commite6542f3fb2dd57ea8ca7ab710cb7b70abba16590 (patch)
treed9f0cc1507cabbd7fb556b054da2ec52641bb667 /modules
parentOnly show first line of commit message (diff)
signature
Correctly show new tags being created in modules/github.py
Diffstat (limited to 'modules')
-rw-r--r--modules/github.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/github.py b/modules/github.py
index 1de730fa..cdd51b2c 100644
--- a/modules/github.py
+++ b/modules/github.py
@@ -3,6 +3,7 @@ from src import ModuleManager, utils
COMMIT_URL = "https://github.com/%s/commit/%s"
COMMIT_RANGE_URL = "https://github.com/%s/compare/%s…%s"
+TAG_URL = "https://github.com/%s/releases/tag/%s"
COMMENT_ACTIONS = {
"created": "commented",
@@ -83,7 +84,13 @@ class Module(ModuleManager.BaseModule):
def push(self, event, full_name, data):
outputs = []
- if len(data["commits"]) <= 3:
+ ref = data["ref"]
+ if ref.startswith("refs/tags/"):
+ tag = ref.split("refs/tags/", 1)[1]
+ pusher = utils.irc.bold(data["pusher"]["name"])
+ outputs.append("(%s) %s pushed new tag: %s - %s"
+ % (full_name, pusher, tag, TAG_URL % tag))
+ elif len(data["commits"]) <= 3:
for commit in data["commits"]:
id = self._short_hash(commit["id"])
message = commit["message"].split("\n")[0].strip()