Skip to content

Commit

Permalink
fix(outgoing-webhook): fix template usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed Nov 14, 2022
1 parent 18183cf commit 1860cba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/integration/webhook/generic/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/ncarlier/readflow/pkg/config"
"github.com/ncarlier/readflow/pkg/constant"
"github.com/ncarlier/readflow/pkg/helper"
"github.com/ncarlier/readflow/pkg/integration/webhook"
"github.com/ncarlier/readflow/pkg/model"
)
Expand Down Expand Up @@ -72,7 +73,7 @@ func newWebhookProvider(srv model.OutgoingWebhook, conf config.Config) (webhook.
// Validate format
var tpl *template.Template
if config.Format != "" {
tplName := fmt.Sprintf("webhook-%d", *srv.ID)
tplName := fmt.Sprintf("webhook-%s", helper.Hash(config.Format))
tpl, err = template.New(tplName).Parse(config.Format)
if err != nil {
return nil, err
Expand Down

0 comments on commit 1860cba

Please sign in to comment.