Include ignored Discord errors in summary

This commit is contained in:
Nuckyz 2023-11-30 02:38:12 -03:00
parent 66dbe7ef07
commit 8e1546be00
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -105,7 +105,14 @@ async function printReport() {
console.log();
report.otherErrors = report.otherErrors.filter(e => !IGNORED_DISCORD_ERRORS.some(regex => e.match(regex)));
const ignoredErrors = [] as string[];
report.otherErrors = report.otherErrors.filter(e => {
if (IGNORED_DISCORD_ERRORS.some(regex => e.match(regex))) {
ignoredErrors.push(e);
return false;
}
return true;
});
console.log("## Discord Errors");
report.otherErrors.forEach(e => {
@ -114,6 +121,13 @@ async function printReport() {
console.log();
console.log("## Ignored Discord Errors");
ignoredErrors.forEach(e => {
console.log(`- ${toCodeBlock(e)}`);
});
console.log();
if (process.env.DISCORD_WEBHOOK) {
await fetch(process.env.DISCORD_WEBHOOK, {
method: "POST",