diff --git a/actions/setup/js/firewall_blocked_domains.cjs b/actions/setup/js/firewall_blocked_domains.cjs index 8f6397ffa0..69beb00f2e 100644 --- a/actions/setup/js/firewall_blocked_domains.cjs +++ b/actions/setup/js/firewall_blocked_domains.cjs @@ -196,8 +196,7 @@ function generateBlockedDomainsSection(blockedDomains) { const domainWord = domainCount === 1 ? "domain" : "domains"; let section = "\n\n> [!WARNING]\n"; - section += `>
\n`; - section += `> ⚠️ Firewall blocked ${domainCount} ${domainWord}\n`; + section += `> **⚠️ Firewall blocked ${domainCount} ${domainWord}**\n`; section += `>\n`; section += `> The following ${domainWord} ${domainCount === 1 ? "was" : "were"} blocked by the firewall during workflow execution:\n`; section += `>\n`; @@ -220,8 +219,6 @@ function generateBlockedDomainsSection(blockedDomains) { section += `> \`\`\`\n`; section += `>\n`; section += `> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information.\n`; - section += `>\n`; - section += `>
\n`; return section; } diff --git a/actions/setup/js/firewall_blocked_domains.test.cjs b/actions/setup/js/firewall_blocked_domains.test.cjs index 5fd0009869..71c70f8b65 100644 --- a/actions/setup/js/firewall_blocked_domains.test.cjs +++ b/actions/setup/js/firewall_blocked_domains.test.cjs @@ -305,27 +305,23 @@ describe("firewall_blocked_domains.cjs", () => { expect(generateBlockedDomainsSection(undefined)).toBe(""); }); - it("should generate details section for single blocked domain", () => { + it("should generate warning section for single blocked domain", () => { const result = generateBlockedDomainsSection(["blocked.example.com"]); expect(result).toContain("> [!WARNING]"); - expect(result).toContain(">
"); - expect(result).toContain(">
"); - expect(result).toContain("> ⚠️ Firewall blocked 1 domain"); + expect(result).toContain("> **⚠️ Firewall blocked 1 domain**"); expect(result).toContain("> - `blocked.example.com`"); expect(result).toContain("> The following domain was blocked by the firewall during workflow execution:"); expect(result).toContain('> ```yaml\n> network:\n> allowed:\n> - defaults\n> - "blocked.example.com"\n> ```'); expect(result).toContain("> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information."); }); - it("should generate details section for multiple blocked domains", () => { + it("should generate warning section for multiple blocked domains", () => { const domains = ["alpha.example.com", "beta.example.com", "gamma.example.com"]; const result = generateBlockedDomainsSection(domains); expect(result).toContain("> [!WARNING]"); - expect(result).toContain(">
"); - expect(result).toContain(">
"); - expect(result).toContain("> ⚠️ Firewall blocked 3 domains"); + expect(result).toContain("> **⚠️ Firewall blocked 3 domains**"); expect(result).toContain("> - `alpha.example.com`"); expect(result).toContain("> - `beta.example.com`"); expect(result).toContain("> - `gamma.example.com`"); diff --git a/actions/setup/js/gateway_difc_filtered.cjs b/actions/setup/js/gateway_difc_filtered.cjs index 623df6bdc5..234a8f1071 100644 --- a/actions/setup/js/gateway_difc_filtered.cjs +++ b/actions/setup/js/gateway_difc_filtered.cjs @@ -91,12 +91,14 @@ function generateDifcFilteredSection(filteredEvents) { const count = uniqueEvents.length; const itemWord = count === 1 ? "item" : "items"; + const verb = count === 1 ? "was" : "were"; + const subjectNegationPhrase = count === 1 ? "it doesn't" : "they don't"; let section = "\n\n> [!NOTE]\n"; section += `>
\n`; section += `> 🔒 Integrity filter blocked ${count} ${itemWord}\n`; section += `>\n`; - section += `> The following ${itemWord} were blocked because they don't meet the GitHub integrity level.\n`; + section += `> The following ${itemWord} ${verb} blocked because ${subjectNegationPhrase} meet the GitHub integrity level.\n`; section += `>\n`; const maxItems = 16; diff --git a/actions/setup/js/gateway_difc_filtered.test.cjs b/actions/setup/js/gateway_difc_filtered.test.cjs index 71456ee678..6b16c16eb1 100644 --- a/actions/setup/js/gateway_difc_filtered.test.cjs +++ b/actions/setup/js/gateway_difc_filtered.test.cjs @@ -259,7 +259,7 @@ describe("gateway_difc_filtered.cjs", () => { const events = [{ type: "DIFC_FILTERED", tool_name: "tool", reason: "reason" }]; const result = generateDifcFilteredSection(events); - expect(result).toContain("blocked because they don't meet"); + expect(result).toContain("blocked because it doesn't meet"); expect(result).toContain("GitHub integrity level"); }); @@ -300,6 +300,7 @@ describe("gateway_difc_filtered.cjs", () => { const singleResult = generateDifcFilteredSection(singleEvent); expect(singleResult).toContain("1 item"); expect(singleResult).not.toContain("items"); + expect(singleResult).toContain("blocked because it doesn't meet"); const multiEvents = [ { type: "DIFC_FILTERED", tool_name: "tool1", reason: "r1" }, @@ -307,6 +308,7 @@ describe("gateway_difc_filtered.cjs", () => { ]; const multiResult = generateDifcFilteredSection(multiEvents); expect(multiResult).toContain("2 items"); + expect(multiResult).toContain("blocked because they don't meet"); }); it("should deduplicate filtered events with identical fields", () => {