Skip to content

Commit 05eb0bd

Browse files
committed
Revert "fix(ci): Remove log redaction and simplify crash.yml"
This reverts commit 322b842.
1 parent 322b842 commit 05eb0bd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

dev-packages/e2e-tests/cli.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,30 @@ if (actions.includes('test')) {
353353
}
354354
}
355355

356+
// Always redact sensitive data, even if some tests failed
357+
try {
358+
const logDir = path.join(e2eDir, 'maestro-logs');
359+
if (fs.existsSync(logDir)) {
360+
const redactFiles = (dir) => {
361+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
362+
const fullPath = path.join(dir, entry.name);
363+
if (entry.isDirectory()) {
364+
redactFiles(fullPath);
365+
} else {
366+
const content = fs.readFileSync(fullPath, 'utf8');
367+
if (content.includes(sentryAuthToken)) {
368+
fs.writeFileSync(fullPath, content.replaceAll(sentryAuthToken, '[REDACTED]'));
369+
}
370+
}
371+
}
372+
};
373+
redactFiles(logDir);
374+
console.log('Redacted sensitive data from logs');
375+
}
376+
} catch (error) {
377+
console.warn('Failed to redact sensitive data from logs:', error.message);
378+
}
379+
356380
if (failedFlows.length > 0) {
357381
console.error(`\nFailed flows: ${failedFlows.join(', ')}`);
358382
process.exit(1);

0 commit comments

Comments
 (0)