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