File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: 'Cleanup'
22
33on :
44 schedule :
5- - cron : ' 0 */4 * * *'
5+ - cron : ' 0 */6 * * *'
66 workflow_dispatch :
77
88permissions :
@@ -25,12 +25,14 @@ jobs:
2525
2626 - name : Delete services
2727 run : |-
28- BUFFER="$(TZ=GMT+4 date +%Y-%m-%d)"
29-
3028 gcloud config set core/project "${{ secrets.PROJECT_ID }}"
3129 gcloud config set functions/region "us-central1"
3230
33- (IFS=$'\n'; for NAME in $(gcloud functions list --format="value(name)" --filter="updateTime.date('%Y-%m-%d', Z) < '${BUFFER}'"); do
31+ # List and delete all functions that were deployed 30 minutes ago or
32+ # earlier. The date math here is a little weird, but we're looking for
33+ # deployments "earlier than" 30 minutes ago, so it's less than since
34+ # time increases.
35+ (IFS=$'\n'; for NAME in $(gcloud functions list --format="value(name)" --filter="updateTime < '-pt30m'"); do
3436 echo "Deleting ${NAME}..."
3537 gcloud functions delete ${NAME} --quiet
3638 done)
You can’t perform that action at this time.
0 commit comments