aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-20 12:51:11 +0100
committerGravatar jesopo2019-10-20 12:51:11 +0100
commite0403aa3d2541f2b12a359debbc0db7e7fa7fab9 (patch)
treed3212e5c4733291edc29c404c066345f56737b24
parentstill show url when shortening is turned off (diff)
signature
added gitlab Tag Push events
-rw-r--r--modules/git_webhooks/gitlab.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/git_webhooks/gitlab.py b/modules/git_webhooks/gitlab.py
index 9661549f..73749850 100644
--- a/modules/git_webhooks/gitlab.py
+++ b/modules/git_webhooks/gitlab.py
@@ -27,13 +27,7 @@ EVENT_CATEGORIES = {
"issue-comment-minimal": [
"issue_comment/created", "issue_comment/deleted"
],
- "repo": [
- "create", # a repository, branch or tag has been created
- "delete", # same as above but deleted
- "release",
- "fork",
- "repository"
- ]
+ "repo": ["tag_push"]
}
COMMENT_ACTIONS = {
@@ -90,10 +84,21 @@ class GitLab(object):
return self.issues(full_name, data)
elif event == "note":
return self.note(full_name, data)
+ elif event == "tag_push":
+ return self.tag_push(full_name, data)
def _short_hash(self, hash):
return hash[:8]
+ def tag_push(self, full_name, data):
+ create = data["after"].strip("0")==""
+ tag = utils.irc.color(data["ref"].rsplit("/", 1)[-1],
+ colors.COLOR_BRANCH)
+ author = utils.irc.bold(data["user_username"])
+ action = "created" if create else "deleted"
+
+ return ["%s %s a tag: %s" % (author, action, tag)]
+
def push(self, full_name, data):
outputs = []
branch = data["ref"].rpartition("/")[2]