From 1938c2daaf7d2c6a370d479f3934bb81d70043f0 Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Mon, 10 Jun 2019 16:52:51 +0200 Subject: [PATCH] webhook: use runRefType instead of webhook Event --- internal/services/gateway/webhook.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/services/gateway/webhook.go b/internal/services/gateway/webhook.go index 1994269..4027123 100644 --- a/internal/services/gateway/webhook.go +++ b/internal/services/gateway/webhook.go @@ -45,8 +45,8 @@ const ( agolaDefaultYamlConfigFile = "config.yml" // List of runs annotations - AnnotationEventType = "event_type" - AnnotationRunType = "runtype" + AnnotationRunType = "run_type" + AnnotationRefType = "ref_type" AnnotationProjectID = "projectid" AnnotationUserID = "userid" @@ -259,9 +259,11 @@ func (h *webhooksHandler) handleWebhook(r *http.Request) (int, string, error) { env["AGOLA_SKIPSSHHOSTKEYCHECK"] = "1" } + refType := common.WebHookEventToRunRefType(webhookData.Event) + annotations := map[string]string{ AnnotationRunType: string(runType), - AnnotationEventType: string(webhookData.Event), + AnnotationRefType: string(refType), AnnotationCommitSHA: webhookData.CommitSHA, AnnotationRef: webhookData.Ref, AnnotationSender: webhookData.Sender, @@ -294,8 +296,6 @@ func (h *webhooksHandler) handleWebhook(r *http.Request) (int, string, error) { var groupType common.GroupType var group string - refType := common.WebHookEventToRunRefType(webhookData.Event) - if runType == types.RunTypeProject { baseGroupType = common.GroupTypeProject baseGroupID = project.ID