From 086a5ffd22b41766f5cbe2654a53b2771fe004b7 Mon Sep 17 00:00:00 2001 From: jamesread Date: Sat, 7 Feb 2026 00:31:24 +0000 Subject: [PATCH] chore: fix tpl coderabbit suggestions --- service/internal/tpl/templates.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/service/internal/tpl/templates.go b/service/internal/tpl/templates.go index 26f9925..bf0a242 100644 --- a/service/internal/tpl/templates.go +++ b/service/internal/tpl/templates.go @@ -12,7 +12,8 @@ import ( log "github.com/sirupsen/logrus" ) -var tpl = template.New("tpl") +var tpl = template.New("tpl"). + Option("missingkey=error") type olivetinInfo struct { Build *installationinfo.BuildInfo @@ -183,8 +184,6 @@ func parseTemplate(source string, data any) (string, error) { return "", err } - t = t.Option("missingkey=error") - var sb strings.Builder err = t.Execute(&sb, data) @@ -203,6 +202,10 @@ func parseTemplate(source string, data any) (string, error) { func ParseTemplateOfActionBeforeExec(source string, ent *entities.Entity) string { result, err := ParseTemplateWithActionContext(source, ent, nil) if err != nil { + log.WithFields(log.Fields{ + "source": source, + "err": err, + }).Errorf("Error parsing template of action before exec") return "" } return result