From 8bbb810e7940814e681718ba2c0fd48c758ee378 Mon Sep 17 00:00:00 2001 From: TJ Silver Date: Fri, 10 Jan 2025 15:16:15 +0000 Subject: [PATCH] refactor: move language check into exempted repo --- .../dependency_graph-integrator/send-to-sns.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/repocop/src/remediation/dependency_graph-integrator/send-to-sns.ts b/packages/repocop/src/remediation/dependency_graph-integrator/send-to-sns.ts index 2eea1b1c3..0d16dfa13 100644 --- a/packages/repocop/src/remediation/dependency_graph-integrator/send-to-sns.ts +++ b/packages/repocop/src/remediation/dependency_graph-integrator/send-to-sns.ts @@ -126,10 +126,12 @@ export function repoIsExempted( exemptedCustomProperties: github_repository_custom_properties[], language: DepGraphLanguage, ): boolean { - const exemptedRepo = exemptedCustomProperties.find( - (property) => repo.id === property.repository_id, - ); - if (exemptedRepo && exemptedRepo.value === language) { + const exemptedRepo: github_repository_custom_properties | undefined = + exemptedCustomProperties.find( + (property) => + repo.id === property.repository_id && language === property.value, + ); + if (exemptedRepo) { logger.log({ message: `${repo.name} is exempted from dependency graph integration for ${language}`, numexemptedCustomProperties: exemptedCustomProperties.length,