Skip to content

Commit

Permalink
Check for payload.repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcampbell committed Dec 13, 2023
1 parent c0c3744 commit d5a7b21
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/functions/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
});
}

0 comments on commit d5a7b21

Please sign in to comment.