Skip to content

Commit

Permalink
Fix github action
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 560849062
  • Loading branch information
wanyingd1996 authored and Dagger Team committed Aug 28, 2023
1 parent 046baa4 commit 232e524
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions util/cleanup-github-caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ def main(argv):


def get_created_at(cache):
return datetime.datetime.strptime(
cache['created_at'].split('.')[0],
'%Y-%m-%dT%H:%M:%S'
)
created_at = cache['created_at'].split('.')[0]
# GitHub changed its date format so support both the old and new format for
# now.
for date_format in ('%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%M:%S'):
try:
return datetime.datetime.strptime(created_at, date_format)
except ValueError:
pass
raise ValueError('no valid date format found: "%s"' % created_at)


def delete_cache(cache):
Expand Down

0 comments on commit 232e524

Please sign in to comment.