mirror of
https://github.com/thegeeklab/drone-matrix.git
synced 2024-11-25 03:30:39 +00:00
fix: fix template context and default template
This commit is contained in:
parent
ea81ac130e
commit
3fd2dfdafa
@ -55,7 +55,7 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
|
|||||||
Name: "template",
|
Name: "template",
|
||||||
EnvVars: []string{"PLUGIN_TEMPLATE", "MATRIX_TEMPLATE"},
|
EnvVars: []string{"PLUGIN_TEMPLATE", "MATRIX_TEMPLATE"},
|
||||||
Usage: "sets message template",
|
Usage: "sets message template",
|
||||||
Value: "Build {{ build.status }} [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}",
|
Value: "Build {{ build.Status }} [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate commit.SHA 8 }}]({{ build.Link }}) ({{ build.Branch }}) by {{ commit.Author }}",
|
||||||
Destination: &settings.Template,
|
Destination: &settings.Template,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ func (p *Plugin) Execute() error {
|
|||||||
return fmt.Errorf("failed to join room: %w", err)
|
return fmt.Errorf("failed to join room: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
message, err := template.RenderTrim(p.settings.Template, p)
|
message, err := template.RenderTrim(p.settings.Template, p.pipeline)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to render template: %w", err)
|
return fmt.Errorf("failed to render template: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user