From 1ec73fe0165703594f76d09a834df9562e234188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Thu, 18 Jan 2024 09:04:43 +0100 Subject: [PATCH] Add a ping route for UptimeRobot --- appFn.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/appFn.ts b/appFn.ts index b7d71d4..87a9766 100644 --- a/appFn.ts +++ b/appFn.ts @@ -1,11 +1,14 @@ -import { Probot } from 'probot'; +import { ApplicationFunction, Probot } from 'probot'; import getMetaData from 'metadata-scraper'; import { getPlaylistIdFromUrl } from './getPlaylistIdFromUrl'; type ReviewEvent = 'REQUEST_CHANGES' | 'COMMENT' | 'APPROVE'; -const appFn = (app: Probot) => { +const appFn: ApplicationFunction = (app: Probot, { getRouter }) => { + const router = getRouter!('/ping'); + router.get('/pong', (req, res) => res.sendStatus(200)); + app.on( ['pull_request.opened', 'pull_request.synchronize'], async ({ payload, octokit, log }) => {