From 30a3d44a6de52b0a606a808412d76bbc19a08f12 Mon Sep 17 00:00:00 2001 From: _tthemzdl5678 <107047730+ThemeHackers@users.noreply.github.com> Date: Tue, 2 Dec 2025 12:06:58 +0700 Subject: [PATCH] Update gh_public_events.py --- src/gitxray/include/gh_public_events.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gitxray/include/gh_public_events.py b/src/gitxray/include/gh_public_events.py index f171a77..bbe9419 100644 --- a/src/gitxray/include/gh_public_events.py +++ b/src/gitxray/include/gh_public_events.py @@ -87,7 +87,9 @@ def log_events(events, gx_output, for_repository=False): # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#pushevent elif etype == "PushEvent": - logging_func(f"{ts}: {actor}pushed a total of {len(payload.get('commits'))} commits from: [{payload.get('ref')}]", rtype="90d_events") + commits = payload.get('commits') + if commits is None: commits = [] + logging_func(f"{ts}: {actor}pushed a total of {len(commits)} commits from: [{payload.get('ref')}]", rtype="90d_events") # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#releaseevent elif etype == "ReleaseEvent":