diff --git a/jeeves/core/actions/files.py b/jeeves/core/actions/files.py index 91a6574..f553832 100644 --- a/jeeves/core/actions/files.py +++ b/jeeves/core/actions/files.py @@ -31,13 +31,15 @@ class TemplateAction(Action): def execute(self, **kwargs): workspace = kwargs.get("workspace") arguments = kwargs.get("arguments") + execution = kwargs.get("execution") source_path = os.path.join(os.getcwd(), self.parameters.src) assert os.path.exists(source_path), "Source template does not exist" template = Template(open(source_path, "r").read()) + rendered = template.render(current_execution=execution, **arguments) with open(os.path.join(workspace.path, self.parameters.dest), "w") as handler: - handler.write(template.render(**arguments)) + handler.write(rendered) - return Result(success=True) + return Result(success=True, output=rendered)