Skip to content

Commit 194ffd4

Browse files
authored
Apply progressive disclosure to firewall blocked domains alert (#28332)
1 parent 75491ff commit 194ffd4

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

actions/setup/js/firewall_blocked_domains.test.cjs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ describe("firewall_blocked_domains.cjs", () => {
316316
const result = generateBlockedDomainsSection(["blocked.example.com"], TEMPLATE_PATH);
317317

318318
expect(result).toContain("> [!WARNING]");
319-
expect(result).toContain("> **⚠️ Firewall blocked 1 domain**");
319+
expect(result).toContain("> <details>");
320+
expect(result).toContain("> <summary>Firewall blocked 1 domain</summary>");
321+
expect(result).toContain("> </details>");
320322
expect(result).toContain("> - `blocked.example.com`");
321323
expect(result).toContain("> The following domain was blocked by the firewall during workflow execution:");
322324
expect(result).toContain('> ```yaml\n> network:\n> allowed:\n> - defaults\n> - "blocked.example.com"\n> ```');
@@ -328,7 +330,9 @@ describe("firewall_blocked_domains.cjs", () => {
328330
const result = generateBlockedDomainsSection(domains, TEMPLATE_PATH);
329331

330332
expect(result).toContain("> [!WARNING]");
331-
expect(result).toContain("> **⚠️ Firewall blocked 3 domains**");
333+
expect(result).toContain("> <details>");
334+
expect(result).toContain("> <summary>Firewall blocked 3 domains</summary>");
335+
expect(result).toContain("> </details>");
332336
expect(result).toContain("> - `alpha.example.com`");
333337
expect(result).toContain("> - `beta.example.com`");
334338
expect(result).toContain("> - `gamma.example.com`");
@@ -360,7 +364,8 @@ describe("firewall_blocked_domains.cjs", () => {
360364
const result = generateBlockedDomainsSection(["api.github.com"], TEMPLATE_PATH);
361365

362366
expect(result).toContain("> [!WARNING]");
363-
expect(result).toContain("> **⚠️ Firewall blocked 1 domain**");
367+
expect(result).toContain("> <details>");
368+
expect(result).toContain("> <summary>Firewall blocked 1 domain</summary>");
364369
expect(result).toContain("> - `api.github.com`");
365370
expect(result).toContain("`tools.github.mode: gh-proxy`");
366371
expect(result).toContain("> ```yaml\n> tools:\n> github:\n> mode: gh-proxy\n> ```");
@@ -373,7 +378,8 @@ describe("firewall_blocked_domains.cjs", () => {
373378
const result = generateBlockedDomainsSection(domains, TEMPLATE_PATH);
374379

375380
expect(result).toContain("> [!WARNING]");
376-
expect(result).toContain("> **⚠️ Firewall blocked 2 domains**");
381+
expect(result).toContain("> <details>");
382+
expect(result).toContain("> <summary>Firewall blocked 2 domains</summary>");
377383
expect(result).toContain("> - `api.github.com`");
378384
expect(result).toContain("> - `other.example.com`");
379385
expect(result).toContain("> ```yaml\n> tools:\n> github:\n> mode: gh-proxy\n> ```");

actions/setup/md/firewall_blocked_domains.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
> [!WARNING]
2-
> **⚠️ Firewall blocked {domain_count} {domain_word}**
2+
> <details>
3+
> <summary>Firewall blocked {domain_count} {domain_word}</summary>
34
>
45
> The following {domain_word} {verb} blocked by the firewall during workflow execution:
56
>
@@ -25,3 +26,5 @@
2526
{yaml_network_list}> ```
2627
>
2728
> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information.
29+
>
30+
> </details>

0 commit comments

Comments
 (0)