|
|
@ -417,32 +417,28 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string, |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var payload BasePayload |
|
|
|
switch w.HookTaskType { |
|
|
|
switch w.HookTaskType { |
|
|
|
case SLACK: |
|
|
|
case SLACK: |
|
|
|
{ |
|
|
|
s, err := GetSlackPayload(p, w.Meta) |
|
|
|
s, err := GetSlackPayload(p, w.Meta) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return errors.New("action.GetSlackPayload: " + err.Error()) |
|
|
|
return errors.New("action.GetSlackPayload: " + err.Error()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CreateHookTask(&HookTask{ |
|
|
|
|
|
|
|
Type: w.HookTaskType, |
|
|
|
|
|
|
|
Url: w.Url, |
|
|
|
|
|
|
|
BasePayload: s, |
|
|
|
|
|
|
|
ContentType: w.ContentType, |
|
|
|
|
|
|
|
IsSsl: w.IsSsl, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
payload = s |
|
|
|
default: |
|
|
|
default: |
|
|
|
{ |
|
|
|
payload = p |
|
|
|
p.Secret = w.Secret |
|
|
|
p.Secret = w.Secret |
|
|
|
CreateHookTask(&HookTask{ |
|
|
|
} |
|
|
|
Type: w.HookTaskType, |
|
|
|
|
|
|
|
Url: w.Url, |
|
|
|
if err = CreateHookTask(&HookTask{ |
|
|
|
BasePayload: p, |
|
|
|
Type: w.HookTaskType, |
|
|
|
ContentType: w.ContentType, |
|
|
|
Url: w.Url, |
|
|
|
IsSsl: w.IsSsl, |
|
|
|
BasePayload: payload, |
|
|
|
}) |
|
|
|
ContentType: w.ContentType, |
|
|
|
} |
|
|
|
EventType: HOOK_EVENT_PUSH, |
|
|
|
|
|
|
|
IsSsl: w.IsSsl, |
|
|
|
|
|
|
|
}); err != nil { |
|
|
|
|
|
|
|
return fmt.Errorf("CreateHookTask: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|