mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-02 21:58:43 +00:00
parent
dd930e5754
commit
d284aeb545
3 changed files with 3 additions and 2 deletions
|
@ -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"},
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue