From fe3e5c2a04d6d3bde33d6bd5b8024176a18319b5 Mon Sep 17 00:00:00 2001 From: Rich Green Date: Fri, 24 May 2024 14:12:51 +0100 Subject: [PATCH] update df logic --- df.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/df.py b/df.py index 1a56cb3..8d2aeca 100644 --- a/df.py +++ b/df.py @@ -24,8 +24,6 @@ # Initialize variables runs = [] per_page = 100 -num_excluded_runs = 0 - date_format = "%Y-%m-%dT%H:%M:%SZ" # Read ACCESS_TOKEN from environment @@ -64,11 +62,9 @@ print(f"Error retrieving workflow runs: {e}") # Calculate number of successful runs (minus the excluded runs) -num_runs = len(runs) -num_excluded_runs += len( - [run for run in runs if run["name"] in excluded_workflows] +num_successful_runs += len( + [run for run in runs if run["name"] not in excluded_workflows] ) -num_successful_runs = (num_runs - num_excluded_runs) # Compute the number of days between the earliest and latest successful runs if num_successful_runs > 0: