Skip to content

Commit

Permalink
Add set of ignored events (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Dec 23, 2023
1 parent 39fb9e9 commit adbed02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions services/bots/src/github-webhook/github-webhook.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { EventType, WEBHOOK_HANDLERS } from './github-webhook.const';
import { GithubClient, WebhookContext } from './github-webhook.model';
import { uniqueEntries } from './utils/list';

const ignoredEventActions = new Set(['new_permissions_accepted']);

@Injectable()
export class GithubWebhookService {
private githubClient: GithubClient;
Expand Down Expand Up @@ -51,6 +53,11 @@ export class GithubWebhookService {
}

async handleWebhook(headers: Record<string, any>, payload: Record<string, any>): Promise<void> {
if (ignoredEventActions.has(payload.action)) {
// We do not handle these events.
return;
}

const context = new WebhookContext({
github: this.githubClient,
eventType: `${headers['x-github-event']}.${payload.action}` as EventType,
Expand Down

0 comments on commit adbed02

Please sign in to comment.