diff --git a/internal/pipe/bluesky/bluesky.go b/internal/pipe/bluesky/bluesky.go index 27e3643df..8e5c82a87 100644 --- a/internal/pipe/bluesky/bluesky.go +++ b/internal/pipe/bluesky/bluesky.go @@ -10,7 +10,7 @@ import ( "github.com/bluesky-social/indigo/lex/util" butil "github.com/bluesky-social/indigo/util" "github.com/bluesky-social/indigo/xrpc" - "github.com/caarlos0/env/v9" + "github.com/caarlos0/env/v11" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" ) @@ -26,7 +26,7 @@ func (Pipe) String() string { return "bluesky" } func (Pipe) Skip(ctx *context.Context) bool { return !ctx.Config.Announce.Bluesky.Enabled } type Config struct { - Password string `env:"BLUESKY_ACCOUNT_PASSWORD,notEmpty"` + Password string `env:"BLUESKY_APP_PASSWORD,notEmpty"` } func (Pipe) Default(ctx *context.Context) error { @@ -74,8 +74,7 @@ func (p Pipe) Announce(ctx *context.Context) error { } httpClient := butil.RobustHTTPClient() - - userAgent := fmt.Sprintf("goreleaser/%s", ctx.Version) + userAgent := "goreleaser/v1" xrpcClient := &xrpc.Client{ Client: httpClient, diff --git a/internal/pipe/bluesky/bluesky_test.go b/internal/pipe/bluesky/bluesky_test.go index 062358d6b..bf95754b9 100644 --- a/internal/pipe/bluesky/bluesky_test.go +++ b/internal/pipe/bluesky/bluesky_test.go @@ -38,7 +38,7 @@ func TestAnnounceMissingEnv(t *testing.T) { }, }) require.NoError(t, bluesky.Pipe{}.Default(ctx)) - require.EqualError(t, bluesky.Pipe{}.Announce(ctx), `bluesky: env: environment variable "BLUESKY_ACCOUNT_PASSWORD" should not be empty`) + require.EqualError(t, bluesky.Pipe{}.Announce(ctx), `bluesky: env: environment variable "BLUESKY_APP_PASSWORD" should not be empty`) } func TestSkip(t *testing.T) { @@ -60,21 +60,21 @@ func TestSkip(t *testing.T) { func TestLive(t *testing.T) { t.SkipNow() - t.Setenv("BLUESKY_ACCOUNT_PASSWORD", "TODO") + t.Setenv("BLUESKY_APP_PASSWORD", "TODO") ctx := testctx.NewWithCfg(config.Project{ Announce: config.Announce{ Bluesky: config.Bluesky{ MessageTemplate: "This is a sample announcement from the forthcoming {{ .ProjectName }} Bluesky support. View the details at {{ .ReleaseURL }}", Enabled: true, - Username: "jaygles.bsky.social", + Username: "caarlos0.dev", }, }, }) ctx.Config.ProjectName = "Goreleaser" - ctx.ReleaseURL = "https://en.wikipedia.org/wiki/ALF_(TV_series)" - ctx.Version = "dev-bluesky" + ctx.ReleaseURL = "https://goreleaser.com/customization/announce/bluesky" + ctx.Version = "v1.26.0" require.NoError(t, bluesky.Pipe{}.Default(ctx)) require.NoError(t, bluesky.Pipe{}.Announce(ctx))