MCPcopy Create free account
hub / github.com/github/gh-aw / writeRedactedDomainsLog

Function writeRedactedDomainsLog

actions/setup/js/sanitize_content_core.cjs:52–71  ·  view source on GitHub ↗

* Writes the collected redacted URL domains to a log file. * Only creates the file if there are redacted domains. * @param {string} [filePath] - Path to write the log file. Defaults to /tmp/gh-aw/redacted-urls.log * @returns {string|null} The file path if written, null if no domains to write

(filePath)

Source from the content-addressed store, hash-verified

50 * @returns {string|null} The file path if written, null if no domains to write
51 */
52function writeRedactedDomainsLog(filePath) {
53 if (redactedDomains.length === 0) {
54 return null;
55 }
56
57 const fs = require("fs");
58 const path = require("path");
59 const targetPath = filePath || "/tmp/gh-aw/redacted-urls.log";
60
61 // Ensure directory exists
62 const dir = path.dirname(targetPath);
63 if (!fs.existsSync(dir)) {
64 fs.mkdirSync(dir, { recursive: true });
65 }
66
67 // Write domains to file, one per line
68 fs.writeFileSync(targetPath, redactedDomains.join("\n") + "\n");
69
70 return targetPath;
71}
72
73/**
74 * Extract domains from a URL and return an array of domain variations

Callers 3

mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected