diff --git a/cmd/server/flags.go b/cmd/server/flags.go index cfeb763c8..b274aaf83 100644 --- a/cmd/server/flags.go +++ b/cmd/server/flags.go @@ -244,7 +244,7 @@ var flags = append([]cli.Flag{ EnvVars: []string{"WOODPECKER_STATUS_CONTEXT_FORMAT"}, Name: "status-context-format", Usage: "status context format", - Value: "{{ .context }}/{{ .event }}/{{ .workflow }}{{if not (eq .axis_id 0}}/{{.axis_id}}{{end}}", + Value: "{{ .context }}/{{ .event }}/{{ .workflow }}{{if not (eq .axis_id 0)}}/{{.axis_id}}{{end}}", }, &cli.BoolFlag{ EnvVars: []string{"WOODPECKER_MIGRATIONS_ALLOW_LONG"}, diff --git a/docs/docs/30-administration/10-server-config.md b/docs/docs/30-administration/10-server-config.md index ba5ac735d..26d775f79 100644 --- a/docs/docs/30-administration/10-server-config.md +++ b/docs/docs/30-administration/10-server-config.md @@ -517,7 +517,7 @@ Context prefix Woodpecker will use to publish status messages to SCM. You probab ### `WOODPECKER_STATUS_CONTEXT_FORMAT` -> Default: `{{ .context }}/{{ .event }}/{{ .workflow }}{{if not (eq .axis_id 0}}/{{.axis_id}}{{end}}` +> Default: `{{ .context }}/{{ .event }}/{{ .workflow }}{{if not (eq .axis_id 0)}}/{{.axis_id}}{{end}}` Template for the status messages published to forges, uses [Go templates](https://pkg.go.dev/text/template) as template language. Supported variables: diff --git a/server/forge/common/status.go b/server/forge/common/status.go index fca6ffe32..14f1cf6b3 100644 --- a/server/forge/common/status.go +++ b/server/forge/common/status.go @@ -34,6 +34,7 @@ func GetPipelineStatusContext(repo *model.Repo, pipeline *model.Pipeline, workfl tmpl, err := template.New("context").Parse(server.Config.Server.StatusContextFormat) if err != nil { + log.Error().Err(err).Msg("could not create status from template") return "" } var ctx bytes.Buffer