Skip to content

Commit 3894e77

Browse files
committed
Ignore pull requests from bot users in webhook listener
1 parent 1555cec commit 3894e77

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/src/controllers/webhook.controller.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import { Endpoints } from '@octokit/types';
88
export const setupWebhookListeners = (github: App) => {
99
github.webhooks.on(["pull_request.opened"], async ({ octokit, payload }) => {
1010
try {
11+
if (payload.pull_request.user.type === 'Bot') {
12+
logger.debug(`Ignoring PR from bot user: ${payload.pull_request.user.login}`);
13+
return;
14+
}
15+
1116
const survey = await surveyService.createSurvey({
1217
status: 'pending',
1318
hits: 0,

0 commit comments

Comments
 (0)