MCPcopy Create free account
hub / github.com/github/gh-aw / renderTemplateFromFile

Function renderTemplateFromFile

actions/setup/js/messages_core.cjs:140–143  ·  view source on GitHub ↗

* Read a template file and render it with the given context. * Combines file loading and template rendering into a single helper. * @param {string} templatePath - Absolute path to the template file * @param {Record } context - Key-value pairs for replacemen

(templatePath, context)

Source from the content-addressed store, hash-verified

138 * @returns {string} Rendered template with placeholders replaced
139 */
140function renderTemplateFromFile(templatePath, context) {
141 const template = fs.readFileSync(templatePath, "utf8");
142 return renderTemplate(template, context);
143}
144
145/**
146 * Convert context object keys to snake_case for template rendering.

Calls 1

renderTemplateFunction · 0.85

Tested by

no test coverage detected