diff --git a/pages/api/governance-notifier.api.ts b/pages/api/gov-notifier.api.ts similarity index 73% rename from pages/api/governance-notifier.api.ts rename to pages/api/gov-notifier.api.ts index b287be491c..8689b1c075 100644 --- a/pages/api/governance-notifier.api.ts +++ b/pages/api/gov-notifier.api.ts @@ -2,9 +2,9 @@ import { withSentry } from '@sentry/nextjs' import { runNotifier } from '../../scripts/governance-notifier' async function handler(req, res) { - // if (req?.headers?.authorization !== `Bearer ${process.env.CRON_SECRET}`) { - // return res.status(401).send('Unauthorized') - // } + if (req?.headers?.authorization !== `Bearer ${process.env.CRON_SECRET}`) { + return res.status(401).send('Unauthorized') + } try { await runNotifier() res.status(200).send('Notifier executed successfully') diff --git a/scripts/governance-notifier.ts b/scripts/governance-notifier.ts index 4ffd8d511f..4fd875a8a8 100644 --- a/scripts/governance-notifier.ts +++ b/scripts/governance-notifier.ts @@ -206,6 +206,7 @@ export async function runNotifier() { } if (!webhookTriggered && process.env.WEBHOOK_URL) { + console.log("Nothing to Report") axios.post(process.env.WEBHOOK_URL, { content: 'Nothing to Report' }) } diff --git a/vercel.json b/vercel.json index 49c5ea9ade..5aa6c620a7 100644 --- a/vercel.json +++ b/vercel.json @@ -1,7 +1,7 @@ { "crons": [ { - "path": "/api/governance-notifier", + "path": "/api/gov-notifier", "schedule": "*/10 * * * *" } ]