diff --git a/zerver/tests.py b/zerver/tests.py index 8d4649d307..141cf1e97c 100644 --- a/zerver/tests.py +++ b/zerver/tests.py @@ -5303,6 +5303,11 @@ class GithubHookTests(AuthedTestCase): "zulip-test: pull request 7: Counting is hard.", "zbenjamin closed [pull request 7](https://github.com/zbenjamin/zulip-test/pull/7)") + def test_pull_request_synchronize(self): + self.basic_test('pull_request_synchronize', 'commits', + "zulip-test: pull request 13: Even more cowbell.", + "zbenjamin synchronized [pull request 13](https://github.com/zbenjamin/zulip-test/pull/13)") + def test_pull_request_comment(self): self.basic_test('pull_request_comment', 'commits', "zulip-test: pull request 9: Less cowbell.", diff --git a/zerver/views/webhooks.py b/zerver/views/webhooks.py index b3a7ef9ff7..efd16f2bc6 100644 --- a/zerver/views/webhooks.py +++ b/zerver/views/webhooks.py @@ -25,10 +25,14 @@ def github_generic_subject(noun, topic_focus, blob): return "%s: %s %d: %s" % (topic_focus, noun, blob['number'], blob['title']) def github_generic_content(noun, payload, blob): + action = payload['action'] + if action == 'synchronize': + action = 'synchronized' + # issue and pull_request objects have the same fields we're interested in content = ("%s %s [%s %s](%s)" % (payload['sender']['login'], - payload['action'], + action, noun, blob['number'], blob['html_url']))