Skip to content

Commit

Permalink
run on schedule too
Browse files Browse the repository at this point in the history
  • Loading branch information
tolzhabayev committed Dec 29, 2023
1 parent f917626 commit 74ff18c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/feature-toggle-cleanup.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 74ff18c

Please sign in to comment.