From 98c6bded9844078189c01a522c275810ddb7cda6 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Mon, 1 Jan 2024 09:59:57 -0300 Subject: [PATCH] Fix: Triage Tools: Python error when accessing a 'created branch' activity `activity["content"]` is empty in these cases. --- tools/triage/weekly_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/triage/weekly_report.py b/tools/triage/weekly_report.py index f83b2d689b0..1c49ad61034 100644 --- a/tools/triage/weekly_report.py +++ b/tools/triage/weekly_report.py @@ -99,7 +99,7 @@ def report_personal_weekly_get(username, start, verbose=True): fullname = activity["repo"]["full_name"] + "/pulls/" + activity["content"].split('|')[0] pulls_created.add(fullname) elif op_type == "commit_repo": - if activity["ref_name"] == "refs/heads/main": + if activity["ref_name"] == "refs/heads/main" and activity["content"]: content_json = json.loads(activity["content"]) repo_name = activity["repo"]["name"] for commits in content_json["Commits"]: