Correctly show new tags being created in modules/github.py
This commit is contained in:
parent
9f086d56a4
commit
e6542f3fb2
1 changed files with 8 additions and 1 deletions
|
@ -3,6 +3,7 @@ from src import ModuleManager, utils
|
||||||
|
|
||||||
COMMIT_URL = "https://github.com/%s/commit/%s"
|
COMMIT_URL = "https://github.com/%s/commit/%s"
|
||||||
COMMIT_RANGE_URL = "https://github.com/%s/compare/%s…%s"
|
COMMIT_RANGE_URL = "https://github.com/%s/compare/%s…%s"
|
||||||
|
TAG_URL = "https://github.com/%s/releases/tag/%s"
|
||||||
|
|
||||||
COMMENT_ACTIONS = {
|
COMMENT_ACTIONS = {
|
||||||
"created": "commented",
|
"created": "commented",
|
||||||
|
@ -83,7 +84,13 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
def push(self, event, full_name, data):
|
def push(self, event, full_name, data):
|
||||||
outputs = []
|
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"]:
|
for commit in data["commits"]:
|
||||||
id = self._short_hash(commit["id"])
|
id = self._short_hash(commit["id"])
|
||||||
message = commit["message"].split("\n")[0].strip()
|
message = commit["message"].split("\n")[0].strip()
|
||||||
|
|
Loading…
Reference in a new issue