From 53b24070727e35e4ab93099dbb86074f18b80e17 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 18 Oct 2019 11:19:16 +0100 Subject: 'open' -> 'opened' etc for gitlab issue webhook actions --- modules/git_webhooks/gitlab.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'modules/git_webhooks/gitlab.py') diff --git a/modules/git_webhooks/gitlab.py b/modules/git_webhooks/gitlab.py index 1b4b3831..d1bae40e 100644 --- a/modules/git_webhooks/gitlab.py +++ b/modules/git_webhooks/gitlab.py @@ -43,6 +43,13 @@ COMMENT_ACTIONS = { "deleted": "deleted a comment" } +ISSUE_ACTIONS = { + "open": "opened", + "close": "closed", + "reopen": "reopened", + "update": "updated" +} + class GitLab(object): def is_private(self, data, headers): if "project" in data: @@ -143,7 +150,7 @@ class GitLab(object): def issues(self, full_name, data): number = utils.irc.color("#%s" % data["object_attributes"]["iid"], colors.COLOR_ID) - action = data["object_attributes"]["action"] + action = ISSUE_ACTIONS[data["object_attributes"]["action"]] issue_title = data["object_attributes"]["title"] author = utils.irc.bold(data["user"]["username"]) url = data["object_attributes"]["url"] -- cgit v1.3.1-10-gc9f91