Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default status #2715

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/30-administration/10-server-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions server/forge/common/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down