mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
github webhook: For release events show actions and tag name.
This commit is contained in:
@@ -205,7 +205,7 @@ class GithubWebhookTest(WebhookTestCase):
|
||||
self.send_and_test_stream_message('team_add', self.EXPECTED_TOPIC_REPO_EVENTS, expected_message)
|
||||
|
||||
def test_release_msg(self) -> None:
|
||||
expected_message = u"baxterthehacker published [the release](https://github.com/baxterthehacker/public-repo/releases/tag/0.0.1)."
|
||||
expected_message = u"baxterthehacker published [release for tag 0.0.1](https://github.com/baxterthehacker/public-repo/releases/tag/0.0.1)."
|
||||
self.send_and_test_stream_message('release', self.EXPECTED_TOPIC_REPO_EVENTS, expected_message)
|
||||
|
||||
def test_page_build_msg(self) -> None:
|
||||
|
||||
@@ -236,8 +236,10 @@ def get_add_team_body(payload: Dict[str, Any]) -> str:
|
||||
)
|
||||
|
||||
def get_release_body(payload: Dict[str, Any]) -> str:
|
||||
return u"{} published [the release]({}).".format(
|
||||
return u"{} {} [release for tag {}]({}).".format(
|
||||
get_sender_name(payload),
|
||||
payload['action'],
|
||||
payload['release']['tag_name'],
|
||||
payload['release']['html_url'],
|
||||
)
|
||||
|
||||
@@ -502,7 +504,7 @@ def get_event(request: HttpRequest, payload: Dict[str, Any], branches: str) -> O
|
||||
# Unsupported pull_request events
|
||||
if action in ('labeled', 'unlabeled', 'review_request_removed'):
|
||||
return None
|
||||
if event == 'push':
|
||||
elif event == 'push':
|
||||
if is_commit_push_event(payload):
|
||||
if branches is not None:
|
||||
branch = get_branch_name_from_ref(payload['ref'])
|
||||
|
||||
Reference in New Issue
Block a user