goreleaser/goreleaser · error

could not evaluate mcp.disable: %w

Error message

could not evaluate mcp.disable: %w

What it means

Wrapped error in the MCP pipe's Publish: templating the mcp.disable field (from mcp.disable or mcp.github.disable) failed. The boolean/string skip decision is templated before warnExperimental and any publish work; the %w chain identifies the invalid template expression.

Source

Thrown at internal/pipe/mcp/mcp.go:77

		ctx.Config.MCP.Description = ctx.Config.MCP.GitHub.Description
		ctx.Config.MCP.Homepage = ctx.Config.MCP.GitHub.Homepage
		ctx.Config.MCP.Packages = ctx.Config.MCP.GitHub.Packages
		ctx.Config.MCP.Transports = ctx.Config.MCP.GitHub.Transports
		ctx.Config.MCP.Disable = ctx.Config.MCP.GitHub.Disable
		ctx.Config.MCP.Repository = ctx.Config.MCP.GitHub.Repository
		ctx.Config.MCP.Auth = ctx.Config.MCP.GitHub.Auth
	}

	ctx.Config.MCP.Auth.Type = cmp.Or(ctx.Config.MCP.Auth.Type, proto.MethodNone)
	return nil
}

func (p Pipe) Publish(ctx *context.Context) error {
	mcp := ctx.Config.MCP

	disable, err := tmpl.New(ctx).Apply(mcp.Disable)
	if err != nil {
		return fmt.Errorf("could not evaluate mcp.disable: %w", err)
	}
	if strings.TrimSpace(disable) == "true" {
		return pipe.Skip("mcp.disable is set")
	}
	if strings.TrimSpace(disable) == "auto" && ctx.Semver.Prerelease != "" {
		return pipe.Skip("prerelease detected with 'auto' disable, skipping mcp publish")
	}

	warnExperimental()

	if err := tmpl.New(ctx).ApplyAll(
		&mcp.Name,
		&mcp.Description,
		&mcp.Title,
		&mcp.Homepage,
		&mcp.Repository.URL,
		&mcp.Repository.Source,
		&mcp.Repository.ID,

View on GitHub (pinned to f5edd73956)

Solutions

  1. Fix the mcp.disable template expression so it evaluates to a valid boolean/string
  2. Use only available template fields in the disable expression
  3. Test with `goreleaser release --snapshot` to validate template evaluation early
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/pipe/mcp/mcp.go:77 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goreleaser/goreleaser@f5edd73956 (2026-09-05). Data as JSON: /api/errors/6ec76531171eddf5. Report an issue: GitHub.