Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
integrations: Add user url for star event in Github Integration.
dhruv30200367125acaa6ba
diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.pyindex 6ae518a6f1f..41ca6451fec 100644--- a/zerver/webhooks/github/tests.py+++ b/zerver/webhooks/github/tests.py@@ -25,7 +25,7 @@ class GitHubWebhookTest(WebhookTestCase):self.check_webhook("ping", TOPIC_REPO, expected_message)def test_star_event(self) -> None:- expected_message = "Codertocat starred the repository [Codertocat/Hello-World](https://github.com/Codertocat/Hello-World)."+ expected_message = "[Codertocat](https://github.com/Codertocat) starred the repository [Codertocat/Hello-World](https://github.com/Codertocat/Hello-World)."expected_topic = "Hello-World"self.check_webhook("star", expected_topic, expected_message)diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.pyindex 7b3c9b561f6..c08b2269b45 100644--- a/zerver/webhooks/github/view.py+++ b/zerver/webhooks/github/view.py@@ -597,9 +597,10 @@ Check [{name}]({html_url}) {status} ({conclusion}). ([{short_hash}]({commit_url}def get_star_body(helper: Helper) -> str:payload = helper.payload- template = "{user} {action} the repository [{repo}]({url})."+ template = "[{user}]({user_url}) {action} the repository [{repo}]({url})."return template.format(user=payload["sender"]["login"].tame(check_string),+ user_url=get_sender_url(payload),action="starred" if payload["action"].tame(check_string) == "created" else "unstarred",repo=get_repository_full_name(payload),url=payload["repository"]["html_url"].tame(check_string),@@ -627,6 +628,10 @@ def get_sender_name(payload: WildValue) -> str:return payload["sender"]["login"].tame(check_string)+def get_sender_url(payload: WildValue) -> str:+ return payload["sender"]["html_url"].tame(check_string)++def get_branch_name_from_ref(ref_string: str) -> str:return re.sub(r"^refs/heads/", "", ref_string)