-
Notifications
You must be signed in to change notification settings - Fork 296
Enhance firewall blocked domains footer with fix snippet and docs link #18676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,6 +192,19 @@ function generateBlockedDomainsSection(blockedDomains) { | |
| section += `> - \`${domain}\`\n`; | ||
| } | ||
|
|
||
| section += `>\n`; | ||
| section += `> To allow these domains, add them to the \`network.allowed\` list in your workflow frontmatter:\n`; | ||
| section += `>\n`; | ||
| section += `> \`\`\`yaml\n`; | ||
| section += `> network:\n`; | ||
| section += `> allowed:\n`; | ||
| section += `> - defaults\n`; | ||
| for (const domain of blockedDomains) { | ||
| section += `> - "${domain}"\n`; | ||
| } | ||
|
Comment on lines
+201
to
+204
|
||
| section += `> \`\`\`\n`; | ||
| section += `>\n`; | ||
| section += `> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information.\n`; | ||
| section += `>\n`; | ||
| section += `> </details>\n`; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -263,6 +263,8 @@ describe("firewall_blocked_domains.cjs", () => { | |
| expect(result).toContain("> <summary>⚠️ Firewall blocked 1 domain</summary>"); | ||
| 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."); | ||
|
Comment on lines
+266
to
+267
|
||
| }); | ||
|
|
||
| it("should generate details section for multiple blocked domains", () => { | ||
|
|
@@ -276,6 +278,8 @@ describe("firewall_blocked_domains.cjs", () => { | |
| expect(result).toContain("> - `alpha.example.com`"); | ||
| expect(result).toContain("> - `beta.example.com`"); | ||
| expect(result).toContain("> - `gamma.example.com`"); | ||
| expect(result).toContain('> ```yaml\n> network:\n> allowed:\n> - defaults\n> - "alpha.example.com"\n> - "beta.example.com"\n> - "gamma.example.com"\n> ```'); | ||
| expect(result).toContain("> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information."); | ||
| }); | ||
|
|
||
| it("should use correct singular/plural form", () => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text says "To allow these domains" even when only a single blocked domain is listed. This will produce grammatically incorrect guidance in the 1-domain case; please make the wording conditional (e.g., "this domain" vs "these domains").