goreleaser/goreleaser · error
could not apply templates: %w
Error message
could not apply templates: %w
What it means
Wrapped error in the MCP pipe's Publish: the batched tmpl.ApplyAll over the mcp section's string fields (name, description, title, homepage, repository.*, auth.*) failed on at least one field. The %w chain names which template expression was invalid.
Source
Thrown at internal/pipe/mcp/mcp.go:100
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,
&mcp.Repository.Subfolder,
&mcp.Auth.Type,
&mcp.Auth.Token,
); err != nil {
return fmt.Errorf("could not apply templates: %w", err)
}
provider, err := p.authProviderFn(
p.registry,
mcp.Auth.Type,
mcp.Auth.Token,
)
if err != nil {
return fmt.Errorf("could not login: %w", err)
}
if err := provider.Login(ctx); err != nil {
return fmt.Errorf("could not login: %w", err)
}
defer func() {
// logout...
_ = os.Remove(gitHubTokenFilePath)
_ = os.Remove(registryTokenFilePath)
}()View on GitHub (pinned to f5edd73956)
Solutions
- Fix invalid template syntax or unknown fields in the mcp config (name, description, title, urls, auth)
- Use only variables available in the publish environment
- Run goreleaser check to validate the mcp section
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/pipe/mcp/mcp.go:100 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/a62b100a3373bf54.
Report an issue: GitHub.