From 121642eb4c118a743657720f66774734f6141def Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Fri, 30 Aug 2024 12:59:43 +0300 Subject: [PATCH] Added service account IDs to mark as read --- app/Services/GitHub.php | 6 +++--- config/bots.php | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Services/GitHub.php b/app/Services/GitHub.php index 193faf1..f096536 100644 --- a/app/Services/GitHub.php +++ b/app/Services/GitHub.php @@ -187,7 +187,7 @@ protected function shouldSkip(NotificationData $notification, ItemData $item): b return true; } - if ($this->exceptMentions && $notification->reason === 'mention' && $this->isNotDependabot($item)) { + if ($this->exceptMentions && $notification->reason === 'mention' && $this->isNotServiceAccount($item)) { return true; } @@ -223,8 +223,8 @@ protected function detected(int $count): void Output::info("unread $pluralized detected", $count); } - protected function isNotDependabot(ItemData $item): bool + protected function isNotServiceAccount(ItemData $item): bool { - return $item->ownerId !== config('bots.dependabot'); + return ! in_array($item->ownerId, config('bots.accounts'), true); } } diff --git a/config/bots.php b/config/bots.php index 63e10b9..e0937f4 100644 --- a/config/bots.php +++ b/config/bots.php @@ -1,5 +1,9 @@ 49699333, + 'accounts' => [ + 9919, // GitHub + 49699333, // dependabot + 41898282, // GitHub Actions + ], ];