From 08a8e22899a28527572c82047c7345b08f564499 Mon Sep 17 00:00:00 2001 From: wayonb Date: Fri, 25 Jul 2025 17:17:01 -0400 Subject: [PATCH] [jenkins] fix: handle deleted GitHub user during build problem: gitstamp will failed to find commit user due to account deletion solution: set the username to '' when it fails to get GitHub username --- source/_ext/gitstamp.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/_ext/gitstamp.py b/source/_ext/gitstamp.py index 359a3dd12..416fd63ad 100644 --- a/source/_ext/gitstamp.py +++ b/source/_ext/gitstamp.py @@ -70,9 +70,14 @@ def page_context_handler(app, pagename, templatename, context, doctree): # Try searching the commit hash instead gh_commit = gh_repo.get_commit(commit.hexsha) if gh_commit: - user.name = gh_commit.author.name - user.login = gh_commit.author.login - user.avatar_url = gh_commit.author.avatar_url + try: + user.name = gh_commit.author.name + user.login = gh_commit.author.login + user.avatar_url = gh_commit.author.avatar_url + except: + user.name = '' + user.login = '' + user.avatar_url = None gh_user_cache[commit.author.email] = user context['gitauthor'] = user.name