Skip to content

Commit

Permalink
refactor: ♻️ exit push event in the case of no entry in installation …
Browse files Browse the repository at this point in the history
…collection
  • Loading branch information
slugb0t committed Aug 2, 2024
1 parent ba378cc commit ed91ea5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,14 @@ export default async (app, { getRouter }) => {

const emptyRepo = await isRepoEmpty(context, owner, repoName);

await verifyInstallationAnalytics(context, repository);
const installationCollection = db.collection("installation");
const installation = await installationCollection.findOne({
repositoryId: repository.id,
});

if (!installation) {
return;
}

// Grab the commits being pushed
const { commits } = context.payload;
Expand Down

0 comments on commit ed91ea5

Please sign in to comment.