webhook: use runRefType instead of webhook Event
This commit is contained in:
parent
28ddfb1781
commit
1938c2daaf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue