From 2048bc2d8fdb649e46d6fe272aa5e11f2b079224 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 8 Feb 2023 14:25:50 +0100 Subject: [PATCH] chore: replace deprecated template-lib (#101) --- go.mod | 5 ++--- go.sum | 8 ++------ plugin/impl.go | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index e0bb63f..301187b 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,7 @@ require ( github.com/microcosm-cc/bluemonday v1.0.22 github.com/russross/blackfriday/v2 v2.1.0 github.com/sirupsen/logrus v1.9.0 - github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1 - github.com/thegeeklab/drone-template-lib/v2 v2.2.1 + github.com/thegeeklab/drone-plugin-lib/v2 v2.3.1 github.com/urfave/cli/v2 v2.24.3 maunium.net/go/mautrix v0.13.0 ) @@ -20,7 +19,6 @@ require ( github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/flowchartsman/handlebars/v3 v3.0.1 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/css v1.0.0 // indirect github.com/huandu/xstrings v1.3.3 // indirect @@ -37,4 +35,5 @@ require ( golang.org/x/crypto v0.5.0 // indirect golang.org/x/net v0.5.0 // indirect golang.org/x/sys v0.4.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index c94f250..0eed37b 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/flowchartsman/handlebars/v3 v3.0.1 h1:16YAX2vJ2X2wgliz4QoUNyOJDLmnZ7Uldg/5w49/z3A= -github.com/flowchartsman/handlebars/v3 v3.0.1/go.mod h1:HGaRKxnZS8F2cteR3rusKeY+lI9fbnqwwesT+A3a18I= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -52,10 +50,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1 h1:fta32M+y6aHG/BX+Kwxo9DQAcYpTyCBHn7sAm2qjfL0= -github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1/go.mod h1:Bu++VS6GXEWCHQdzR65dPsGtBGOMuqAQPiRVBaa+HrY= -github.com/thegeeklab/drone-template-lib/v2 v2.2.1 h1:+O9S7ahjinxkufHvEb4w5zUT1a7HbyB3PVM68q7aMTs= -github.com/thegeeklab/drone-template-lib/v2 v2.2.1/go.mod h1:Y33XBbCwwWWumkq0su8b0kKXLl4WRwRpCXS8WVc5REw= +github.com/thegeeklab/drone-plugin-lib/v2 v2.3.1 h1:+tbq9I0XwfK38SOWV3rATPdVt4W/KBXDg1ebmFOjCjw= +github.com/thegeeklab/drone-plugin-lib/v2 v2.3.1/go.mod h1:NDOZW0eQz7cXeaWeqVS5lzxrUgxrN/TD2KBjS4fMJLk= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= diff --git a/plugin/impl.go b/plugin/impl.go index 19ab291..925d4b4 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -15,7 +15,7 @@ import ( "github.com/microcosm-cc/bluemonday" "github.com/russross/blackfriday/v2" "github.com/sirupsen/logrus" - "github.com/thegeeklab/drone-template-lib/v2/template" + "github.com/thegeeklab/drone-plugin-lib/v2/template" "maunium.net/go/mautrix" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" @@ -73,7 +73,7 @@ func (p *Plugin) Execute() error { return fmt.Errorf("failed to join room: %w", err) } - message, err := template.RenderTrim(p.settings.Template, p.pipeline) + message, err := template.RenderTrim(p.network.Context, *p.network.Client, p.settings.Template, p.pipeline) if err != nil { return fmt.Errorf("failed to render template: %w", err) }