Discord webhook notifications

Fixes #46
This commit is contained in:
mrrfv
2023-11-08 22:42:02 +01:00
parent 034decc43d
commit e552a8730f
8 changed files with 72 additions and 1 deletions
+3
View File
@@ -1,4 +1,5 @@
import { deleteZeroTrustRule, getZeroTrustRules } from "./lib/api.js";
import { notifyWebhook } from "./lib/helpers.js";
const { result: rules } = await getZeroTrustRules();
const cgpsRule = rules.find(({ name }) => name === "CGPS Filter Lists");
@@ -14,3 +15,5 @@ const cgpsRule = rules.find(({ name }) => name === "CGPS Filter Lists");
console.log(`Deleting rule ${cgpsRule.name}...`);
await deleteZeroTrustRule(cgpsRule.id);
})();
// Send a notification to the webhook
await notifyWebhook("CF Gateway Rule Create script finished running");