diff --git a/cmd/drone-matrix/config.go b/cmd/drone-matrix/config.go index 5d1fc56..edd31e9 100644 --- a/cmd/drone-matrix/config.go +++ b/cmd/drone-matrix/config.go @@ -55,7 +55,7 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Name: "template", EnvVars: []string{"PLUGIN_TEMPLATE", "MATRIX_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, }, } diff --git a/plugin/impl.go b/plugin/impl.go index 7d22197..a240b54 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -62,7 +62,7 @@ func (p *Plugin) Execute() error { 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 { return fmt.Errorf("failed to render template: %w", err)