From 4327f71363f91d794f292d35d096cdd6db1c8421 Mon Sep 17 00:00:00 2001 From: ggnine-jito <122913584+ggnine-jito@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:39:25 -0800 Subject: [PATCH] add summary to nothing urgent hook (#11) --- scripts/governance-notifier.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/governance-notifier.ts b/scripts/governance-notifier.ts index 4fd875a8a8..2637a86450 100644 --- a/scripts/governance-notifier.ts +++ b/scripts/governance-notifier.ts @@ -205,14 +205,19 @@ export async function runNotifier() { } } + const summary = `countOpenForVotingSinceSomeTime: ${countOpenForVotingSinceSomeTime}, countJustOpenedForVoting: ${countJustOpenedForVoting}, countVotingNotStartedYet: ${countVotingNotStartedYet}, countClosed: ${countClosed}, countCancelled: ${countCancelled}` if (!webhookTriggered && process.env.WEBHOOK_URL) { - console.log("Nothing to Report") - axios.post(process.env.WEBHOOK_URL, { content: 'Nothing to Report' }) + console.log('Nothing urgent to Report') + axios + .post(process.env.WEBHOOK_URL, { + content: 'Nothing urgent to Report: ' + summary, + }) + .then(() => { + console.log('Nothing Webhook Triggered') + }) } - console.log( - `-- countOpenForVotingSinceSomeTime: ${countOpenForVotingSinceSomeTime}, countJustOpenedForVoting: ${countJustOpenedForVoting}, countVotingNotStartedYet: ${countVotingNotStartedYet}, countClosed: ${countClosed}, countCancelled: ${countCancelled}` - ) + console.log(summary) } errorWrapper()