Skip to content

Commit

Permalink
add excluded workflow logic to cfr
Browse files Browse the repository at this point in the history
  • Loading branch information
richgreen-moj committed May 24, 2024
1 parent 0886250 commit e2d4e2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

# load the repository names from a JSON file
with open(args.filename, "r") as f:
repos = json.load(f)["repos"]
data = json.load(f)
repos = data['repos']
excluded_workflows = data['excluded_workflows']

filename, file_extension = os.path.splitext(args.filename)
# Initialize variables
Expand All @@ -54,7 +56,7 @@
workflow_runs = get_workflow_runs(OWNER, repo, ACCESS_TOKEN, params)
total_workflow_runs += len(workflow_runs)
total_unsuccessful_runs += len(
[run for run in workflow_runs if run["conclusion"] != "success"]
[run for run in workflow_runs if run["conclusion"] != "success" and run["name"] not in excluded_workflows]
)


Expand Down

0 comments on commit e2d4e2a

Please sign in to comment.