From d5a7b21973e833ef238b5484c16ca0b7d75810b9 Mon Sep 17 00:00:00 2001 From: Chris Campbell <808531+ctcampbell@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:24:20 +0000 Subject: [PATCH] Check for payload.repository --- src/functions/app.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/functions/app.ts b/src/functions/app.ts index 71e63c1..8a18b95 100644 --- a/src/functions/app.ts +++ b/src/functions/app.ts @@ -3,11 +3,13 @@ import { Probot } from "probot"; export = (app: Probot) => { app.onAny(async (context: any) => { const octokit = await app.auth(context.payload.installation.id); - await octokit.repos.createDispatchEvent({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - event_type: context.name, - client_payload: context.payload - }); + if (context.payload.repository !== undefined) { + await octokit.repos.createDispatchEvent({ + owner: context.payload.repository.owner.login, + repo: context.payload.repository.name, + event_type: context.name, + client_payload: context.payload + }); + } }); }