d790a9edfe
- Add internal/notify package: best-effort release notifications to Slack, Microsoft Teams, Google Chat, Telegram, and a generic JSON webhook; every target is independently opt-in and a failed notification never fails the release - Add notify config section (slack_webhook_url, teams_webhook_url, google_chat_webhook_url, telegram_bot_token/telegram_chat_id, webhook_url) with matching env var fallbacks; 100% coverage plus FuzzMessagePayloads - Wire notification sending into run() — fires after tag+push (including --no-release), skipped on --no-push/--no-commit since nothing was published yet - Document the notify section in README, Hugo docs, and .releaser.yml template; update CLAUDE.md architecture/fuzzing tables - Also commit the Apache License 2.0 docs-site footer link (docs/hugo.toml geekdocContentLicense), left uncommitted from a prior change Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
771 B
Go
32 lines
771 B
Go
package notify
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// teamsPayload is a Microsoft Teams "Incoming Webhook" O365 connector card
|
|
// (MessageCard schema) — the format Teams webhook URLs still accept.
|
|
type teamsPayload struct {
|
|
Type string `json:"@type"`
|
|
Context string `json:"@context"`
|
|
Summary string `json:"summary"`
|
|
Title string `json:"title"`
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
func newTeamsPayload(msg Message) teamsPayload {
|
|
title := fmt.Sprintf("Released %s", msg.Version)
|
|
return teamsPayload{
|
|
Type: "MessageCard",
|
|
Context: "http://schema.org/extensions",
|
|
Summary: title,
|
|
Title: title,
|
|
Text: msg.Notes,
|
|
}
|
|
}
|
|
|
|
func sendTeams(ctx context.Context, webhookURL string, msg Message) error {
|
|
return postJSON(ctx, webhookURL, newTeamsPayload(msg))
|
|
}
|