Skip to content

Commit b9d1fb6

Browse files
dangriertechknowlogick
authored andcommitted
Add support for MS Teams webhooks (#6632)
1 parent 2af67f6 commit b9d1fb6

File tree

14 files changed

+825
-1
lines changed

14 files changed

+825
-1
lines changed

docs/content/doc/features/comparison.en-us.md

+1
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,5 @@ _Symbols used in table:_
122122
| Two factor authentication (2FA) ||||||||
123123
| Mattermost/Slack integration ||||||||
124124
| Discord integration ||||||||
125+
| Microsoft Teams integration ||||||||
125126
| External CI/CD status display ||||||||

models/webhook.go

+9
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ const (
466466
DISCORD
467467
DINGTALK
468468
TELEGRAM
469+
MSTEAMS
469470
)
470471

471472
var hookTaskTypes = map[string]HookTaskType{
@@ -475,6 +476,7 @@ var hookTaskTypes = map[string]HookTaskType{
475476
"discord": DISCORD,
476477
"dingtalk": DINGTALK,
477478
"telegram": TELEGRAM,
479+
"msteams": MSTEAMS,
478480
}
479481

480482
// ToHookTaskType returns HookTaskType by given name.
@@ -497,6 +499,8 @@ func (t HookTaskType) Name() string {
497499
return "dingtalk"
498500
case TELEGRAM:
499501
return "telegram"
502+
case MSTEAMS:
503+
return "msteams"
500504
}
501505
return ""
502506
}
@@ -675,6 +679,11 @@ func prepareWebhook(e Engine, w *Webhook, repo *Repository, event HookEventType,
675679
if err != nil {
676680
return fmt.Errorf("GetTelegramPayload: %v", err)
677681
}
682+
case MSTEAMS:
683+
payloader, err = GetMSTeamsPayload(p, event, w.Meta)
684+
if err != nil {
685+
return fmt.Errorf("GetMSTeamsPayload: %v", err)
686+
}
678687
default:
679688
p.SetSecret(w.Secret)
680689
payloader = p

0 commit comments

Comments
 (0)