From e2d4e2a827b3a6a12a24a816da610bf3f8a8ebb8 Mon Sep 17 00:00:00 2001 From: Rich Green Date: Fri, 24 May 2024 13:22:14 +0100 Subject: [PATCH] add excluded workflow logic to cfr --- cfr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cfr.py b/cfr.py index 3b414cc..dcfc77c 100644 --- a/cfr.py +++ b/cfr.py @@ -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 @@ -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] )