diff --git a/.github/workflows/feature-toggle-cleanup.yml b/.github/workflows/feature-toggle-cleanup.yml index fc07e63..88a7703 100644 --- a/.github/workflows/feature-toggle-cleanup.yml +++ b/.github/workflows/feature-toggle-cleanup.yml @@ -1,8 +1,10 @@ name: Feature Toggle Cleanup on: - workflow_dispatch: - + workflow_dispatch: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '30 10 * * *' jobs: fetch: runs-on: ubuntu-latest 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 6db3713..35bc293 100644 --- a/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.mjs +++ b/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.mjs @@ -26,11 +26,11 @@ export default function cleanupFeatureFlags() { cast_date: true, }); - console.log('sixMonthAgo', sixMonthAgo); + // Here we can have the custom logic of how to handle what type of feature flag - e.g. GA can be treated differently than experimental and so on. for (const flag of parsedFeatureFlags) { - console.log(flag); if (flag.Created < sixMonthAgo) { console.log(`The flag ${flag.Name} was created more than 6 months ago. It should be checked.`); + console.log(flag); } }