Skip to content

Commit

Permalink
Merge pull request #5 from ctcampbell/improve-event-handling
Browse files Browse the repository at this point in the history
Improve event handling
  • Loading branch information
ctcampbell authored Dec 13, 2023
2 parents c0c3744 + d5a7b21 commit 299a12d
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 299a12d

Please sign in to comment.