Fix default status (#2715)

Regression #2695

probably closes #2716
This commit is contained in:
qwerty287 2023-11-03 13:00:34 +01:00 committed by GitHub
parent dd930e5754
commit d284aeb545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -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"},

View file

@ -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:

View file

@ -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