Skip to content

Commit 8061961

Browse files
authored
Merge pull request #7 from dash14/feature/add-rule-type-explanation
Simplify report table layout and add rule type note
2 parents eeedafd + bea52ce commit 8061961

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

assets/report-audit-mode.png

40.1 KB
Loading

assets/report-restrict-mode.png

21.8 KB
Loading

report/main.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ function aggregate(filtered) {
8585

8686
function markdownTable(rows, { showReason = false } = {}) {
8787
if (showReason) {
88-
const lines = ["| Host | Port | Type | Reason | Count |", "| --- | --- | --- | --- | ---: |"];
88+
const lines = ["| Host | Rule | Reason | Count |", "| --- | --- | --- | ---: |"];
8989
for (const r of rows) {
90-
lines.push(`| ${r.host} | ${r.port || ""} | ${r.ruleType} | ${r.reason} | ${r.count} |`);
90+
lines.push(`| ${r.host}:${r.port} | ${r.ruleType} | ${r.reason} | ${r.count} |`);
9191
}
9292
return lines.join("\n");
9393
}
94-
const lines = ["| Host | Port | Type | Count |", "| --- | --- | --- | ---: |"];
94+
const lines = ["| Host | Rule | Count |", "| --- | --- | ---: |"];
9595
for (const r of rows) {
96-
lines.push(`| ${r.host} | ${r.port || ""} | ${r.ruleType} | ${r.count} |`);
96+
lines.push(`| ${r.host}:${r.port} | ${r.ruleType} | ${r.count} |`);
9797
}
9898
return lines.join("\n");
9999
}
@@ -125,6 +125,8 @@ if (isAudit) {
125125
}
126126
}
127127

128+
markdown += "\n<sub>*Note: HTTP rules are based on the Host header, HTTPS rules on SNI, and IP rules on the destination IP address.*</sub>\n";
129+
128130
const actionRepo = process.env.GITHUB_ACTION_REPOSITORY || "dash14/buildcage";
129131
markdown += `\n*Reported by [buildcage](https://github.com/${actionRepo})*\n`;
130132

0 commit comments

Comments
 (0)