Add support for MS Teams webhooks (#6632)
This commit is contained in:
parent
2af67f6044
commit
b9d1fb6de3
14 changed files with 825 additions and 1 deletions
|
@ -466,6 +466,7 @@ const (
|
|||
DISCORD
|
||||
DINGTALK
|
||||
TELEGRAM
|
||||
MSTEAMS
|
||||
)
|
||||
|
||||
var hookTaskTypes = map[string]HookTaskType{
|
||||
|
@ -475,6 +476,7 @@ var hookTaskTypes = map[string]HookTaskType{
|
|||
"discord": DISCORD,
|
||||
"dingtalk": DINGTALK,
|
||||
"telegram": TELEGRAM,
|
||||
"msteams": MSTEAMS,
|
||||
}
|
||||
|
||||
// ToHookTaskType returns HookTaskType by given name.
|
||||
|
@ -497,6 +499,8 @@ func (t HookTaskType) Name() string {
|
|||
return "dingtalk"
|
||||
case TELEGRAM:
|
||||
return "telegram"
|
||||
case MSTEAMS:
|
||||
return "msteams"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
@ -675,6 +679,11 @@ func prepareWebhook(e Engine, w *Webhook, repo *Repository, event HookEventType,
|
|||
if err != nil {
|
||||
return fmt.Errorf("GetTelegramPayload: %v", err)
|
||||
}
|
||||
case MSTEAMS:
|
||||
payloader, err = GetMSTeamsPayload(p, event, w.Meta)
|
||||
if err != nil {
|
||||
return fmt.Errorf("GetMSTeamsPayload: %v", err)
|
||||
}
|
||||
default:
|
||||
p.SetSecret(w.Secret)
|
||||
payloader = p
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue