1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/pipe/teams/teams.go

84 lines
2.3 KiB
Go
Raw Normal View History

package teams
import (
"fmt"
goteamsnotify "github.com/atc0005/go-teams-notify/v2"
feat(deps): bump github.com/atc0005/go-teams-notify/v2 from 2.6.1 to 2.7.0 (#3638) Bumps [github.com/atc0005/go-teams-notify/v2](https://github.com/atc0005/go-teams-notify) from 2.6.1 to 2.7.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/atc0005/go-teams-notify/releases">github.com/atc0005/go-teams-notify/v2's releases</a>.</em></p> <blockquote> <h2>v2.7.0</h2> <h2>Added</h2> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/134">GH-134</a>) Allow setting user agent, fallback to project-specific default value</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/135">GH-135</a>) Allow overriding default <code>http.Client</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/157">GH-157</a>) Add <code>Adaptive Card</code> message format support <ul> <li>see also discussion from <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/127">GH-127</a>, including feedback from <a href="https://github.com/ghokun"><code>@​ghokun</code></a></li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/169">GH-169</a>) Added YAML en(de)coding support to <code>MessageCard</code> <ul> <li>credit: <a href="https://github.com/pcanilho"><code>@​pcanilho</code></a></li> </ul> </li> </ul> <h2>Changed</h2> <ul> <li>Dependencies <ul> <li><code>github.com/stretchr/testify</code> <ul> <li><code>v1.7.0</code> to <code>v1.8.1</code></li> </ul> </li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/154">GH-154</a>) Deprecate API interface, expose underlying &quot;Teams&quot; client</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/183">GH-183</a>) Update Makefile and GitHub Actions Workflows</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">GH-190</a>) Refactor GitHub Actions workflows to import logic</li> </ul> <h2>Fixed</h2> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/166">GH-166</a>) Update <code>lintinstall</code> Makefile recipe</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/184">GH-184</a>) Apply Go 1.19 specific doc comments linting fixes</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/176">GH-176</a>) <code>./send_test.go:238:8: second argument to errors.As should not be *error</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/179">GH-179</a>) Wrong json key name for URL (uses uri instead) <ul> <li>credit: <a href="https://github.com/janfonas"><code>@​janfonas</code></a></li> </ul> </li> </ul> <h2>References</h2> <ul> <li>See the <a href="https://github.com/atc0005/go-teams-notify/milestone/11?closed=1"><code>v2.7.0</code> milestone</a> for the issues associated with this release.</li> <li>See our <a href="https://github.com/atc0005/go-teams-notify/blob/master/CHANGELOG.md">CHANGELOG</a> for more information.</li> </ul> <h2>v2.7.0-rc.2</h2> <h2>WARNING</h2> <p>This is a release candidate (RC) release. Unless issues are discovered &amp; reported, this will become the next v2.7.0 stable release.</p> <p>Please test and provide feedback so that any blocking issues can be resolved before the v2.7.0 release.</p> <p>Thanks in advance!</p> <h2>Changes for the <code>v2.7.0-rc.2</code> release</h2> <ul> <li>dependency updates</li> <li>CI tweaks/enhancements</li> </ul> <h2>Changes for the <code>v2.7.0-rc.1</code> release</h2> <ul> <li>Go 1.19 specific linting fixes</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/atc0005/go-teams-notify/blob/master/CHANGELOG.md">github.com/atc0005/go-teams-notify/v2's changelog</a>.</em></p> <blockquote> <h2>[v2.7.0] - 2022-12-12</h2> <h3>Added</h3> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/134">GH-134</a>) Allow setting user agent, fallback to project-specific default value</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/135">GH-135</a>) Allow overriding default <code>http.Client</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/157">GH-157</a>) Add <code>Adaptive Card</code> message format support <ul> <li>see also discussion from <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/127">GH-127</a>, including feedback from <a href="https://github.com/ghokun"><code>@​ghokun</code></a></li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/169">GH-169</a>) Added YAML en(de)coding support to <code>MessageCard</code> <ul> <li>credit: <a href="https://github.com/pcanilho"><code>@​pcanilho</code></a></li> </ul> </li> </ul> <h3>Changed</h3> <ul> <li>Dependencies <ul> <li><code>github.com/stretchr/testify</code> <ul> <li><code>v1.7.0</code> to <code>v1.8.1</code></li> </ul> </li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/154">GH-154</a>) Deprecate API interface, expose underlying &quot;Teams&quot; client</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/183">GH-183</a>) Update Makefile and GitHub Actions Workflows</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">GH-190</a>) Refactor GitHub Actions workflows to import logic</li> </ul> <h3>Fixed</h3> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/166">GH-166</a>) Update <code>lintinstall</code> Makefile recipe</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/184">GH-184</a>) Apply Go 1.19 specific doc comments linting fixes</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/176">GH-176</a>) <code>./send_test.go:238:8: second argument to errors.As should not be *error</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/179">GH-179</a>) Wrong json key name for URL (uses uri instead) <ul> <li>credit: <a href="https://github.com/janfonas"><code>@​janfonas</code></a></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/atc0005/go-teams-notify/commit/c205f3b9c9e4b371106e80d00e48083bbe7eee45"><code>c205f3b</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/195">#195</a> from atc0005/update-changelog-for-v2.7.0-release</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/8ea4c384a6502a2955bf020494bc501de2dc7771"><code>8ea4c38</code></a> Update CHANGELOG for v2.7.0 release</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/76cdfd663db78a8c1e2a5de745d1f21b75958fb2"><code>76cdfd6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/191">#191</a> from atc0005/dependabot/go_modules/master/github.com/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/0ae634df2e9ed0f29cce583800ee2a5daf0cab0a"><code>0ae634d</code></a> go.mod: bump github.com/stretchr/testify from 1.8.0 to 1.8.1</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/dece5c5e6f19ade6499c060f1039f26eefc582e2"><code>dece5c5</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">#190</a> from atc0005/ghaw-refactor</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/00f3f9dc82f55bf88770aab8deccc0e13ebec104"><code>00f3f9d</code></a> Refactor GitHub Actions workflows to import logic</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/8524906f8a6a42a069f7203db6a04eef23155462"><code>8524906</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/189">#189</a> from atc0005/dependabot/github_actions/master/github/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/10f4c0e5f937eb1535d7a797db2e605bfa5e1c92"><code>10f4c0e</code></a> ghaw: bump github/codeql-action from 2.1.24 to 2.1.25</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/bf0a4f60967abf55177bd92f42f6f9cabd954121"><code>bf0a4f6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/188">#188</a> from atc0005/dependabot/github_actions/master/github/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/81f64b78267494264169ee1f05201903ea6a1c9d"><code>81f64b7</code></a> ghaw: bump github/codeql-action from 2.1.23 to 2.1.24</li> <li>Additional commits viewable in <a href="https://github.com/atc0005/go-teams-notify/compare/v2.6.1...v2.7.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/atc0005/go-teams-notify/v2&package-manager=go_modules&previous-version=2.6.1&new-version=2.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-15 19:19:31 +02:00
"github.com/atc0005/go-teams-notify/v2/messagecard"
"github.com/caarlos0/env/v9"
"github.com/caarlos0/log"
"github.com/goreleaser/goreleaser/internal/tmpl"
"github.com/goreleaser/goreleaser/pkg/context"
)
const (
defaultColor = "#2D313E"
defaultIcon = "https://goreleaser.com/static/avatar.png"
defaultMessageTemplate = `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}`
defaultMessageTitle = `{{ .ProjectName }} {{ .Tag }} is out!`
)
type Pipe struct{}
feat: improve output and pipe skipping (#2480) * refactor: improve middleware Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: upload tests Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: twitter tests Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: source tests Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: snapshot tests Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * test: improved some tests Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: snapcraft skip Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip slack Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip sign Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip scoop Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip reddit Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip discord Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip publish Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip nfpm Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip milestone Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip custompublishers Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip checksums Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip changelog Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip brew Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip blob Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip before Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip artifactory Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip announce Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip defaults Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: cmds Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip docker Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * chore: todo Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: go.mod Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip release Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: remove old skip pipe errors Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip teams Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip brew Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix/test: skip smtp Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: lint issues Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip docker Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip brew and scoop Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip docker Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip http/artifactory Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * test: increase coverage Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * test: fix Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-09-18 15:21:29 +02:00
func (Pipe) String() string { return "teams" }
func (Pipe) Skip(ctx *context.Context) bool { return !ctx.Config.Announce.Teams.Enabled }
type Config struct {
Webhook string `env:"TEAMS_WEBHOOK,notEmpty"`
}
func (p Pipe) Default(ctx *context.Context) error {
if ctx.Config.Announce.Teams.MessageTemplate == "" {
ctx.Config.Announce.Teams.MessageTemplate = defaultMessageTemplate
}
if ctx.Config.Announce.Teams.TitleTemplate == "" {
ctx.Config.Announce.Teams.TitleTemplate = defaultMessageTitle
}
if ctx.Config.Announce.Teams.IconURL == "" {
ctx.Config.Announce.Teams.IconURL = defaultIcon
}
if ctx.Config.Announce.Teams.Color == "" {
ctx.Config.Announce.Teams.Color = defaultColor
}
return nil
}
func (p Pipe) Announce(ctx *context.Context) error {
title, err := tmpl.New(ctx).Apply(ctx.Config.Announce.Teams.TitleTemplate)
if err != nil {
return fmt.Errorf("teams: %w", err)
}
msg, err := tmpl.New(ctx).Apply(ctx.Config.Announce.Teams.MessageTemplate)
if err != nil {
return fmt.Errorf("teams: %w", err)
}
var cfg Config
if err := env.Parse(&cfg); err != nil {
return fmt.Errorf("teams: %w", err)
}
log.Infof("posting: '%s'", msg)
feat(deps): bump github.com/atc0005/go-teams-notify/v2 from 2.6.1 to 2.7.0 (#3638) Bumps [github.com/atc0005/go-teams-notify/v2](https://github.com/atc0005/go-teams-notify) from 2.6.1 to 2.7.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/atc0005/go-teams-notify/releases">github.com/atc0005/go-teams-notify/v2's releases</a>.</em></p> <blockquote> <h2>v2.7.0</h2> <h2>Added</h2> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/134">GH-134</a>) Allow setting user agent, fallback to project-specific default value</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/135">GH-135</a>) Allow overriding default <code>http.Client</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/157">GH-157</a>) Add <code>Adaptive Card</code> message format support <ul> <li>see also discussion from <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/127">GH-127</a>, including feedback from <a href="https://github.com/ghokun"><code>@​ghokun</code></a></li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/169">GH-169</a>) Added YAML en(de)coding support to <code>MessageCard</code> <ul> <li>credit: <a href="https://github.com/pcanilho"><code>@​pcanilho</code></a></li> </ul> </li> </ul> <h2>Changed</h2> <ul> <li>Dependencies <ul> <li><code>github.com/stretchr/testify</code> <ul> <li><code>v1.7.0</code> to <code>v1.8.1</code></li> </ul> </li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/154">GH-154</a>) Deprecate API interface, expose underlying &quot;Teams&quot; client</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/183">GH-183</a>) Update Makefile and GitHub Actions Workflows</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">GH-190</a>) Refactor GitHub Actions workflows to import logic</li> </ul> <h2>Fixed</h2> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/166">GH-166</a>) Update <code>lintinstall</code> Makefile recipe</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/184">GH-184</a>) Apply Go 1.19 specific doc comments linting fixes</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/176">GH-176</a>) <code>./send_test.go:238:8: second argument to errors.As should not be *error</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/179">GH-179</a>) Wrong json key name for URL (uses uri instead) <ul> <li>credit: <a href="https://github.com/janfonas"><code>@​janfonas</code></a></li> </ul> </li> </ul> <h2>References</h2> <ul> <li>See the <a href="https://github.com/atc0005/go-teams-notify/milestone/11?closed=1"><code>v2.7.0</code> milestone</a> for the issues associated with this release.</li> <li>See our <a href="https://github.com/atc0005/go-teams-notify/blob/master/CHANGELOG.md">CHANGELOG</a> for more information.</li> </ul> <h2>v2.7.0-rc.2</h2> <h2>WARNING</h2> <p>This is a release candidate (RC) release. Unless issues are discovered &amp; reported, this will become the next v2.7.0 stable release.</p> <p>Please test and provide feedback so that any blocking issues can be resolved before the v2.7.0 release.</p> <p>Thanks in advance!</p> <h2>Changes for the <code>v2.7.0-rc.2</code> release</h2> <ul> <li>dependency updates</li> <li>CI tweaks/enhancements</li> </ul> <h2>Changes for the <code>v2.7.0-rc.1</code> release</h2> <ul> <li>Go 1.19 specific linting fixes</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/atc0005/go-teams-notify/blob/master/CHANGELOG.md">github.com/atc0005/go-teams-notify/v2's changelog</a>.</em></p> <blockquote> <h2>[v2.7.0] - 2022-12-12</h2> <h3>Added</h3> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/134">GH-134</a>) Allow setting user agent, fallback to project-specific default value</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/135">GH-135</a>) Allow overriding default <code>http.Client</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/157">GH-157</a>) Add <code>Adaptive Card</code> message format support <ul> <li>see also discussion from <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/127">GH-127</a>, including feedback from <a href="https://github.com/ghokun"><code>@​ghokun</code></a></li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/169">GH-169</a>) Added YAML en(de)coding support to <code>MessageCard</code> <ul> <li>credit: <a href="https://github.com/pcanilho"><code>@​pcanilho</code></a></li> </ul> </li> </ul> <h3>Changed</h3> <ul> <li>Dependencies <ul> <li><code>github.com/stretchr/testify</code> <ul> <li><code>v1.7.0</code> to <code>v1.8.1</code></li> </ul> </li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/154">GH-154</a>) Deprecate API interface, expose underlying &quot;Teams&quot; client</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/183">GH-183</a>) Update Makefile and GitHub Actions Workflows</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">GH-190</a>) Refactor GitHub Actions workflows to import logic</li> </ul> <h3>Fixed</h3> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/166">GH-166</a>) Update <code>lintinstall</code> Makefile recipe</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/184">GH-184</a>) Apply Go 1.19 specific doc comments linting fixes</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/176">GH-176</a>) <code>./send_test.go:238:8: second argument to errors.As should not be *error</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/179">GH-179</a>) Wrong json key name for URL (uses uri instead) <ul> <li>credit: <a href="https://github.com/janfonas"><code>@​janfonas</code></a></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/atc0005/go-teams-notify/commit/c205f3b9c9e4b371106e80d00e48083bbe7eee45"><code>c205f3b</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/195">#195</a> from atc0005/update-changelog-for-v2.7.0-release</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/8ea4c384a6502a2955bf020494bc501de2dc7771"><code>8ea4c38</code></a> Update CHANGELOG for v2.7.0 release</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/76cdfd663db78a8c1e2a5de745d1f21b75958fb2"><code>76cdfd6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/191">#191</a> from atc0005/dependabot/go_modules/master/github.com/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/0ae634df2e9ed0f29cce583800ee2a5daf0cab0a"><code>0ae634d</code></a> go.mod: bump github.com/stretchr/testify from 1.8.0 to 1.8.1</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/dece5c5e6f19ade6499c060f1039f26eefc582e2"><code>dece5c5</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">#190</a> from atc0005/ghaw-refactor</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/00f3f9dc82f55bf88770aab8deccc0e13ebec104"><code>00f3f9d</code></a> Refactor GitHub Actions workflows to import logic</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/8524906f8a6a42a069f7203db6a04eef23155462"><code>8524906</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/189">#189</a> from atc0005/dependabot/github_actions/master/github/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/10f4c0e5f937eb1535d7a797db2e605bfa5e1c92"><code>10f4c0e</code></a> ghaw: bump github/codeql-action from 2.1.24 to 2.1.25</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/bf0a4f60967abf55177bd92f42f6f9cabd954121"><code>bf0a4f6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/188">#188</a> from atc0005/dependabot/github_actions/master/github/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/81f64b78267494264169ee1f05201903ea6a1c9d"><code>81f64b7</code></a> ghaw: bump github/codeql-action from 2.1.23 to 2.1.24</li> <li>Additional commits viewable in <a href="https://github.com/atc0005/go-teams-notify/compare/v2.6.1...v2.7.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/atc0005/go-teams-notify/v2&package-manager=go_modules&previous-version=2.6.1&new-version=2.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-15 19:19:31 +02:00
client := goteamsnotify.NewTeamsClient()
msgCard := messagecard.NewMessageCard()
msgCard.Summary = title
msgCard.ThemeColor = ctx.Config.Announce.Teams.Color
feat(deps): bump github.com/atc0005/go-teams-notify/v2 from 2.6.1 to 2.7.0 (#3638) Bumps [github.com/atc0005/go-teams-notify/v2](https://github.com/atc0005/go-teams-notify) from 2.6.1 to 2.7.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/atc0005/go-teams-notify/releases">github.com/atc0005/go-teams-notify/v2's releases</a>.</em></p> <blockquote> <h2>v2.7.0</h2> <h2>Added</h2> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/134">GH-134</a>) Allow setting user agent, fallback to project-specific default value</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/135">GH-135</a>) Allow overriding default <code>http.Client</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/157">GH-157</a>) Add <code>Adaptive Card</code> message format support <ul> <li>see also discussion from <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/127">GH-127</a>, including feedback from <a href="https://github.com/ghokun"><code>@​ghokun</code></a></li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/169">GH-169</a>) Added YAML en(de)coding support to <code>MessageCard</code> <ul> <li>credit: <a href="https://github.com/pcanilho"><code>@​pcanilho</code></a></li> </ul> </li> </ul> <h2>Changed</h2> <ul> <li>Dependencies <ul> <li><code>github.com/stretchr/testify</code> <ul> <li><code>v1.7.0</code> to <code>v1.8.1</code></li> </ul> </li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/154">GH-154</a>) Deprecate API interface, expose underlying &quot;Teams&quot; client</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/183">GH-183</a>) Update Makefile and GitHub Actions Workflows</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">GH-190</a>) Refactor GitHub Actions workflows to import logic</li> </ul> <h2>Fixed</h2> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/166">GH-166</a>) Update <code>lintinstall</code> Makefile recipe</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/184">GH-184</a>) Apply Go 1.19 specific doc comments linting fixes</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/176">GH-176</a>) <code>./send_test.go:238:8: second argument to errors.As should not be *error</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/179">GH-179</a>) Wrong json key name for URL (uses uri instead) <ul> <li>credit: <a href="https://github.com/janfonas"><code>@​janfonas</code></a></li> </ul> </li> </ul> <h2>References</h2> <ul> <li>See the <a href="https://github.com/atc0005/go-teams-notify/milestone/11?closed=1"><code>v2.7.0</code> milestone</a> for the issues associated with this release.</li> <li>See our <a href="https://github.com/atc0005/go-teams-notify/blob/master/CHANGELOG.md">CHANGELOG</a> for more information.</li> </ul> <h2>v2.7.0-rc.2</h2> <h2>WARNING</h2> <p>This is a release candidate (RC) release. Unless issues are discovered &amp; reported, this will become the next v2.7.0 stable release.</p> <p>Please test and provide feedback so that any blocking issues can be resolved before the v2.7.0 release.</p> <p>Thanks in advance!</p> <h2>Changes for the <code>v2.7.0-rc.2</code> release</h2> <ul> <li>dependency updates</li> <li>CI tweaks/enhancements</li> </ul> <h2>Changes for the <code>v2.7.0-rc.1</code> release</h2> <ul> <li>Go 1.19 specific linting fixes</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/atc0005/go-teams-notify/blob/master/CHANGELOG.md">github.com/atc0005/go-teams-notify/v2's changelog</a>.</em></p> <blockquote> <h2>[v2.7.0] - 2022-12-12</h2> <h3>Added</h3> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/134">GH-134</a>) Allow setting user agent, fallback to project-specific default value</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/135">GH-135</a>) Allow overriding default <code>http.Client</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/157">GH-157</a>) Add <code>Adaptive Card</code> message format support <ul> <li>see also discussion from <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/127">GH-127</a>, including feedback from <a href="https://github.com/ghokun"><code>@​ghokun</code></a></li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/169">GH-169</a>) Added YAML en(de)coding support to <code>MessageCard</code> <ul> <li>credit: <a href="https://github.com/pcanilho"><code>@​pcanilho</code></a></li> </ul> </li> </ul> <h3>Changed</h3> <ul> <li>Dependencies <ul> <li><code>github.com/stretchr/testify</code> <ul> <li><code>v1.7.0</code> to <code>v1.8.1</code></li> </ul> </li> </ul> </li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/154">GH-154</a>) Deprecate API interface, expose underlying &quot;Teams&quot; client</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/183">GH-183</a>) Update Makefile and GitHub Actions Workflows</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">GH-190</a>) Refactor GitHub Actions workflows to import logic</li> </ul> <h3>Fixed</h3> <ul> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/166">GH-166</a>) Update <code>lintinstall</code> Makefile recipe</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/184">GH-184</a>) Apply Go 1.19 specific doc comments linting fixes</li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/176">GH-176</a>) <code>./send_test.go:238:8: second argument to errors.As should not be *error</code></li> <li>(<a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/179">GH-179</a>) Wrong json key name for URL (uses uri instead) <ul> <li>credit: <a href="https://github.com/janfonas"><code>@​janfonas</code></a></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/atc0005/go-teams-notify/commit/c205f3b9c9e4b371106e80d00e48083bbe7eee45"><code>c205f3b</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/195">#195</a> from atc0005/update-changelog-for-v2.7.0-release</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/8ea4c384a6502a2955bf020494bc501de2dc7771"><code>8ea4c38</code></a> Update CHANGELOG for v2.7.0 release</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/76cdfd663db78a8c1e2a5de745d1f21b75958fb2"><code>76cdfd6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/191">#191</a> from atc0005/dependabot/go_modules/master/github.com/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/0ae634df2e9ed0f29cce583800ee2a5daf0cab0a"><code>0ae634d</code></a> go.mod: bump github.com/stretchr/testify from 1.8.0 to 1.8.1</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/dece5c5e6f19ade6499c060f1039f26eefc582e2"><code>dece5c5</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/190">#190</a> from atc0005/ghaw-refactor</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/00f3f9dc82f55bf88770aab8deccc0e13ebec104"><code>00f3f9d</code></a> Refactor GitHub Actions workflows to import logic</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/8524906f8a6a42a069f7203db6a04eef23155462"><code>8524906</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/189">#189</a> from atc0005/dependabot/github_actions/master/github/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/10f4c0e5f937eb1535d7a797db2e605bfa5e1c92"><code>10f4c0e</code></a> ghaw: bump github/codeql-action from 2.1.24 to 2.1.25</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/bf0a4f60967abf55177bd92f42f6f9cabd954121"><code>bf0a4f6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/atc0005/go-teams-notify/issues/188">#188</a> from atc0005/dependabot/github_actions/master/github/...</li> <li><a href="https://github.com/atc0005/go-teams-notify/commit/81f64b78267494264169ee1f05201903ea6a1c9d"><code>81f64b7</code></a> ghaw: bump github/codeql-action from 2.1.23 to 2.1.24</li> <li>Additional commits viewable in <a href="https://github.com/atc0005/go-teams-notify/compare/v2.6.1...v2.7.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/atc0005/go-teams-notify/v2&package-manager=go_modules&previous-version=2.6.1&new-version=2.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-15 19:19:31 +02:00
messageCardSection := messagecard.NewSection()
messageCardSection.ActivityTitle = title
messageCardSection.ActivityText = msg
messageCardSection.Markdown = true
messageCardSection.ActivityImage = ctx.Config.Announce.Teams.IconURL
err = msgCard.AddSection(messageCardSection)
if err != nil {
return fmt.Errorf("teams: %w", err)
}
err = client.Send(cfg.Webhook, msgCard)
if err != nil {
return fmt.Errorf("teams: %w", err)
}
return nil
}