From 402cd15f8ff4d7b41d21971c11fd9d600af40bcd Mon Sep 17 00:00:00 2001 From: Sebastian Florek Date: Thu, 12 Dec 2024 18:21:45 +0100 Subject: [PATCH] allow templating source field in pr automation (#584) --- pkg/pr/creates.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/pr/creates.go b/pkg/pr/creates.go index 5e7502684..62b7da98e 100644 --- a/pkg/pr/creates.go +++ b/pkg/pr/creates.go @@ -21,6 +21,9 @@ func applyCreates(creates *CreateSpec, ctx map[string]interface{}) error { if tpl.External { source = filepath.Join(creates.ExternalDir, source) } + if templatedSource, err := templateReplacement([]byte(source), ctx); err == nil { + source = string(templatedSource) + } destPath := []byte(tpl.Destination) dest, err := templateReplacement(destPath, ctx)