* Creates a parent issue template for grouping sub-issues * @param {string} groupId - The group identifier (workflow ID) * @param {string} titlePrefix - Title prefix to use * @param {string} workflowName - Name of the workflow * @param {string} workflowSourceURL - URL to the workflow source * @
(groupId, titlePrefix, workflowName, workflowSourceURL, expiresHours = 0)
| 180 | * @returns {object} - Template with title and body |
| 181 | */ |
| 182 | function createParentIssueTemplate(groupId, titlePrefix, workflowName, workflowSourceURL, expiresHours = 0) { |
| 183 | // Use applyTitlePrefix to ensure proper spacing after prefix |
| 184 | const title = applyTitlePrefix(`${groupId} - Issue Group`, titlePrefix); |
| 185 | |
| 186 | // Create template context |
| 187 | const templateContext = { |
| 188 | group_id: groupId, |
| 189 | workflow_name: workflowName, |
| 190 | workflow_source_url: workflowSourceURL || "#", |
| 191 | }; |
| 192 | |
| 193 | // Load and render the issue template |
| 194 | const issueTemplatePath = `${process.env.RUNNER_TEMP}/gh-aw/prompts/issue_group_parent.md`; |
| 195 | let body = renderTemplateFromFile(issueTemplatePath, templateContext); |
| 196 | |
| 197 | // Add footer with workflow information |
| 198 | const footer = `\n\n> Workflow: [${workflowName}](${workflowSourceURL})`; |
| 199 | |
| 200 | // Add expiration to footer if configured using ephemerals helper |
| 201 | const footerWithExpiration = addExpirationToFooter(footer, expiresHours, "Parent Issue"); |
| 202 | |
| 203 | body = `${body}${footerWithExpiration}`; |
| 204 | |
| 205 | return { title, body }; |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Normalize and validate issue fields payload for create_issue. |
no test coverage detected