From 49a855915b5a06251c7d962052a8c8ad77bfdb86 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:59:49 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/scripts/find-unused-caches.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/find-unused-caches.py b/.github/scripts/find-unused-caches.py index 33e0b381..69625f59 100644 --- a/.github/scripts/find-unused-caches.py +++ b/.github/scripts/find-unused-caches.py @@ -26,7 +26,7 @@ def fetch_all_caches(repository: str, token: str, per_page: int = 100, max_pages url = f"https://github.com/gitapi/repos/{repository}/actions/caches?page={page + 1}&per_page={per_page}" headers = {"Authorization": f"token {token}"} response = requests.get(url, headers=headers, timeout=10).json() - if 'total_count' not in response: + if "total_count" not in response: raise RuntimeError(response.get("message")) print(f"fetching page... {page} with {per_page} items of expected {response.get('total_count')}") caches = response.get("actions_caches", []) @@ -47,7 +47,7 @@ def fetch_all_caches(repository: str, token: str, per_page: int = 100, max_pages created_at = pandas.to_datetime(cache["created_at"]) last_used_at = pandas.to_datetime(cache["last_accessed_at"]) cache["last_used_days"] = current_date - last_used_at - age_used = cache["last_used_days"].round(freq='min') + age_used = cache["last_used_days"].round(freq="min") size = cache["size_in_bytes"] / (1024 * 1024) print( f"- Cache Key: {cache_key} |"