* Resolve the absolute path to a prompt template file. * Prefers GH_AW_PROMPTS_DIR when set, otherwise falls back to * ${RUNNER_TEMP}/gh-aw/prompts (the runtime location used in production). * Throws if neither GH_AW_PROMPTS_DIR nor RUNNER_TEMP is set. * @param {string} name - Template filename
(name)
| 123 | * @returns {string} Absolute path to the prompt template file |
| 124 | */ |
| 125 | function getPromptPath(name) { |
| 126 | const promptsDir = process.env.GH_AW_PROMPTS_DIR || (process.env.RUNNER_TEMP ? `${process.env.RUNNER_TEMP}/gh-aw/prompts` : null); |
| 127 | if (!promptsDir) { |
| 128 | throw new Error("Cannot resolve prompt path: neither GH_AW_PROMPTS_DIR nor RUNNER_TEMP is set"); |
| 129 | } |
| 130 | return `${promptsDir}/${name}`; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Read a template file and render it with the given context. |
no outgoing calls
no test coverage detected