webhooks_gitea: Use the correct actor for pull_request actions

The user associated to a pull request is always its creator, however,
when closing a pull request, this can be the wrong actor. The paylod
contains the actor in the `sender` value, use this instead.
This commit is contained in:
Tom Hubrecht
2025-10-03 13:56:09 +02:00
committed by Tim Abbott
parent ab8f6891d6
commit 5ed5fa3315

View File

@@ -22,7 +22,7 @@ def format_pull_request_event(payload: WildValue, include_title: bool = False) -
user_name = payload["pull_request"]["merged_by"]["username"].tame(check_string)
action = "merged"
else:
user_name = payload["pull_request"]["user"]["username"].tame(check_string)
user_name = payload["sender"]["username"].tame(check_string)
action = payload["action"].tame(check_string)
url = payload["pull_request"]["html_url"].tame(check_string)