Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion actions/setup/js/add_comment.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ describe("add_comment", () => {
expect(cautionIndex).toBeGreaterThanOrEqual(0);
expect(cautionIndex).toBeLessThan(bodyIndex);
expect(capturedBody).toContain("agentic threat detected");
expect(capturedBody).toContain("<!-- agentic threat detected -->");
expect(capturedBody).toContain("<!-- gh-aw-threat-detected -->");
expect(capturedBody).toContain("> Generated by [Security Test Workflow]");
expect(capturedBody).toMatch(/> \[!CAUTION\][\s\S]*\n\n> Generated by \[Security Test Workflow\]/);

Expand Down
2 changes: 1 addition & 1 deletion actions/setup/js/generate_footer.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ describe("generate_footer.cjs", () => {

expect(result).toContain("> [!CAUTION]");
expect(result).toContain("agentic threat detected");
expect(result).toContain("<!-- agentic threat detected -->");
expect(result).toContain("<!-- gh-aw-threat-detected -->");
expect(result).toContain("Potential security threats were detected");
});

Expand Down
2 changes: 1 addition & 1 deletion actions/setup/js/messages.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ describe("messages.cjs", () => {

expect(result).toContain("> [!CAUTION]");
expect(result).toContain("agentic threat detected");
expect(result).toContain("<!-- agentic threat detected -->");
expect(result).toContain("<!-- gh-aw-threat-detected -->");
expect(result).toContain("Potential security threats were detected");
});

Expand Down
4 changes: 2 additions & 2 deletions actions/setup/js/threat_detection_warning.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function normalizeThreatKinds(reason) {
* @returns {string}
*/
function getThreatDetectedMarker(reason) {
return "<!-- agentic threat detected -->";
return "<!-- gh-aw-threat-detected -->";
}

/**
Expand All @@ -36,7 +36,7 @@ function getThreatDetectedMarker(reason) {
* @returns {string}
*/
function getThreatDetectedMarkerTemplate() {
return "<!-- agentic threat detected -->";
return "<!-- gh-aw-threat-detected -->";
}

/**
Expand Down
4 changes: 2 additions & 2 deletions actions/setup/js/threat_detection_warning.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe("threat_detection_warning", () => {

describe("marker helpers", () => {
it("emits the normative threat marker", () => {
expect(getThreatDetectedMarker("threat_detected,parse_error")).toBe("<!-- agentic threat detected -->");
expect(getThreatDetectedMarkerTemplate()).toBe("<!-- agentic threat detected -->");
expect(getThreatDetectedMarker("threat_detected,parse_error")).toBe("<!-- gh-aw-threat-detected -->");
expect(getThreatDetectedMarkerTemplate()).toBe("<!-- gh-aw-threat-detected -->");
});
});

Expand Down
2 changes: 1 addition & 1 deletion actions/setup/js/update_activation_comment.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const createTestableFunction = scriptContent => {
parse_error: "The threat detection results could not be parsed.",
};
const reasonText = reasons[reason] || "The threat detection analysis could not be completed.";
return `> [!CAUTION]\n> agentic threat detected\n> Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.\n> <!-- agentic threat detected -->\n>\n> ${reasonText}`;
return `> [!CAUTION]\n> agentic threat detected\n> Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.\n> <!-- gh-aw-threat-detected -->\n>\n> ${reasonText}`;
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4242,7 +4242,7 @@ When threat detection executes in `warn` mode and reports a threat signal for a
> Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

2. A visible threat label string: `agentic threat detected`.
3. An XML comment marker in emitted markdown content: `<!-- agentic threat detected -->`.
3. An XML comment marker in emitted markdown content: `<!-- gh-aw-threat-detected -->`.

**Requirement WTD2 (Convertible Fallback)**: For safe output types classified as **Convertible**, implementations MUST transform the operation into the mapped Reviewable type before execution. For this specification, `push_to_pull_request_branch` (also referred to as `update-pull-request-branch`) MUST fall back to `create_pull_request` with the WTD1 caution, label, and XML marker.

Expand Down