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

Function buildCommentBody

actions/setup/js/close_entity_helpers.cjs:50–61  ·  view source on GitHub ↗

* Build comment body with tracker ID and footer * @param {string} body - The original comment body * @param {number|undefined} triggeringIssueNumber - Issue number that triggered this workflow * @param {number|undefined} triggeringPRNumber - PR number that triggered this workflow * @returns {str

(body, triggeringIssueNumber, triggeringPRNumber)

Source from the content-addressed store, hash-verified

48 * @returns {string} The complete comment body with tracker ID and footer
49 */
50function buildCommentBody(body, triggeringIssueNumber, triggeringPRNumber) {
51 const workflowName = process.env.GH_AW_WORKFLOW_NAME || "Workflow";
52 const workflowSource = process.env.GH_AW_WORKFLOW_SOURCE || "";
53 const workflowSourceURL = process.env.GH_AW_WORKFLOW_SOURCE_URL || "";
54 const runUrl = buildWorkflowRunUrl(context, context.repo);
55
56 // Inject CAUTION at top of body if threat detection warning was raised.
57 // Caller is responsible for sanitizing body before passing it here.
58 const detectionCaution = getDetectionCautionAlert(workflowName, runUrl);
59 const bodyWithCaution = detectionCaution ? detectionCaution + "\n\n" + body.trim() : body.trim();
60 return bodyWithCaution + getTrackerID("markdown") + generateFooterWithMessages(workflowName, runUrl, workflowSource, workflowSourceURL, triggeringIssueNumber, triggeringPRNumber, undefined, undefined, { skipDetectionCaution: true });
61}
62
63/**
64 * Check if labels match the required labels filter

Callers 1

processCloseEntityItemsFunction · 0.70

Calls 4

buildWorkflowRunUrlFunction · 0.85
getDetectionCautionAlertFunction · 0.85
getTrackerIDFunction · 0.85

Tested by

no test coverage detected