From f917626481fa4e6e61aac4df95e5a255abf3bd1a Mon Sep 17 00:00:00 2001 From: Timur Olzhabayev Date: Fri, 29 Dec 2023 15:23:06 +0100 Subject: [PATCH] testing --- .../feature-toggle-cleanup/feature-toggle-cleanup.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.mjs b/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.mjs index df4110d..6db3713 100644 --- a/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.mjs +++ b/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.mjs @@ -17,6 +17,7 @@ import fs from 'fs'; export default function cleanupFeatureFlags() { const today = new Date(); + const sixMonthAgo = today.setMonth(today.getMonth() - 6); const inputFileContents = fs.readFileSync(process.env.FEATURE_TOGGLES_CSV_FILE_PATH); const parsedFeatureFlags = parse(inputFileContents, { columns: true, @@ -25,9 +26,10 @@ export default function cleanupFeatureFlags() { cast_date: true, }); + console.log('sixMonthAgo', sixMonthAgo); for (const flag of parsedFeatureFlags) { - console.log(flag); - if (flag.Created > today.setMonth(today.getMonth() - 6)) { + console.log(flag); + if (flag.Created < sixMonthAgo) { console.log(`The flag ${flag.Name} was created more than 6 months ago. It should be checked.`); } }