Skip to content

Commit

Permalink
feat: show merging user instead of OP
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldietzler committed Oct 7, 2024
1 parent e0c29be commit c6aaafb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/services/webhook.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type BaseEvent = {
user: User;
html_url: string;
body: string | null;
merged_by?: User | null;
};

@Injectable()
Expand Down Expand Up @@ -201,12 +202,13 @@ export class WebhookService {
}

private getEmbed(action: string, repositoryName: string, title: string, event: BaseEvent) {
const user = event.merged_by ? event.merged_by : event.user;
return new EmbedBuilder({
title: `[${repositoryName}] ${title} ${action}: #${event.number} ${event.title}`,
author: {
name: event.user.login,
url: event.user.html_url,
iconURL: event.user.avatar_url,
name: user.login,
url: user.html_url,
iconURL: user.avatar_url,
},
url: event.html_url,
description:
Expand Down

0 comments on commit c6aaafb

Please sign in to comment.