You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/cleanup.yml
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ name: 'Cleanup'
2
2
3
3
on:
4
4
schedule:
5
-
- cron: '0 */4 * * *'
5
+
- cron: '0 */6 * * *'
6
6
workflow_dispatch:
7
7
8
8
permissions:
@@ -25,11 +25,13 @@ jobs:
25
25
26
26
- name: Delete services
27
27
run: |-
28
-
BUFFER="$(TZ=GMT+4 date +%Y-%m-%d)"
29
-
30
28
gcloud config set core/project "${{ secrets.PROJECT_ID }}"
31
29
32
-
(IFS=$'\n'; for NAME in $(gcloud app versions list --format="value(id)" --filter="service != "default" AND version.createTime.date('%Y-%m-%d', Z) < '${BUFFER}'"); do
30
+
# List and delete all versions that were deployed 30 minutes ago or
31
+
# earlier. The date math here is a little weird, but we're looking for
32
+
# deployments "earlier than" 30 minutes ago, so it's less than since
33
+
# time increases.
34
+
(IFS=$'\n'; for NAME in $(gcloud app versions list --format="value(id)" --filter="service != "default" AND version.createTime < '-pt30m'"); do
0 commit comments