Skip to content

Commit

Permalink
Add support for MS Teams webhooks (#6632)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrier authored and techknowlogick committed Apr 19, 2019
1 parent 2af67f6 commit b9d1fb6
Show file tree
Hide file tree
Showing 14 changed files with 825 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/content/doc/features/comparison.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@ _Symbols used in table:_
| Two factor authentication (2FA) ||||||||
| Mattermost/Slack integration ||||||||
| Discord integration ||||||||
| Microsoft Teams integration ||||||||
| External CI/CD status display ||||||||
9 changes: 9 additions & 0 deletions models/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ const (
DISCORD
DINGTALK
TELEGRAM
MSTEAMS
)

var hookTaskTypes = map[string]HookTaskType{
Expand All @@ -475,6 +476,7 @@ var hookTaskTypes = map[string]HookTaskType{
"discord": DISCORD,
"dingtalk": DINGTALK,
"telegram": TELEGRAM,
"msteams": MSTEAMS,
}

// ToHookTaskType returns HookTaskType by given name.
Expand All @@ -497,6 +499,8 @@ func (t HookTaskType) Name() string {
return "dingtalk"
case TELEGRAM:
return "telegram"
case MSTEAMS:
return "msteams"
}
return ""
}
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit b9d1fb6

Please sign in to comment.