Skip to content

Commit

Permalink
update df logic
Browse files Browse the repository at this point in the history
  • Loading branch information
richgreen-moj committed May 24, 2024
1 parent cda8db9 commit fe3e5c2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions df.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit fe3e5c2

Please sign in to comment.