From b8c7f6c44cd0c781d25fab6f38171726fa8ac1952fc99b5ce476ed26ec447839 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Sun, 25 Aug 2024 22:31:20 +0200 Subject: [PATCH] . --- gitea-events-rabbitmq-publisher/main.go | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gitea-events-rabbitmq-publisher/main.go b/gitea-events-rabbitmq-publisher/main.go index 877bdcb..e026a16 100644 --- a/gitea-events-rabbitmq-publisher/main.go +++ b/gitea-events-rabbitmq-publisher/main.go @@ -140,6 +140,38 @@ func parseRequestJSON(reqType string, data []byte) (org *common.Organization, ex org = issue.Repository.Owner extraAction = issue.Action + case "issue_label": + issue := common.IssueWebhookEvent{} + if err = json.Unmarshal(data, &issue); err != nil { + return + } + switch issue.Action { + case "label_updated", "label_cleared": + break + default: + err = fmt.Errorf("Unknown Issue Assign webhook action type: %s", issue.Action) + return + } + org = issue.Repository.Owner + extraAction = issue.Action + + case "issue_milestone": + issue := common.IssueWebhookEvent{} + if err = json.Unmarshal(data, &issue); err != nil { + return + } + switch issue.Action { + case "milestoned", "demilestoned": + break + default: + err = fmt.Errorf("Unknown Issue Assign webhook action type: %s", issue.Action) + return + } + org = issue.Repository.Owner + extraAction = issue.Action + + + // case "issue_comment": // case "issue_labelled":