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

Function createParentIssueTemplate

actions/setup/js/create_issue.cjs:182–206  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

180 * @returns {object} - Template with title and body
181 */
182function 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.

Callers 1

findOrCreateParentIssueFunction · 0.85

Calls 3

applyTitlePrefixFunction · 0.85
renderTemplateFromFileFunction · 0.85
addExpirationToFooterFunction · 0.85

Tested by

no test coverage detected