mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
merge-pr.py: Fix random emails appearing in commit logs
...my good friend Claude was probably drunk when he wrote that code.
This commit is contained in:
parent
e2cf5cf145
commit
38f7dec9e7
1 changed files with 1 additions and 7 deletions
|
@ -41,13 +41,7 @@ def get_user_email(g, username):
|
|||
name = user.name if user.name else username
|
||||
if user.email:
|
||||
return f"{name} <{user.email}>"
|
||||
# If public email is not available, try to get from events
|
||||
events = user.get_events()
|
||||
for event in events:
|
||||
if event.type == "PushEvent" and event.payload.get("commits"):
|
||||
for commit in event.payload["commits"]:
|
||||
if commit.get("author") and commit["author"].get("email"):
|
||||
return f"{name} <{commit['author']['email']}>"
|
||||
return f"{name} (@{username})"
|
||||
except Exception as e:
|
||||
print(f"Error fetching email for user {username}: {str(e)}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue