github webhook: For release events show actions and tag name.

This commit is contained in:
Brutus5000
2019-08-17 16:34:42 +02:00
committed by Tim Abbott
parent dac068df31
commit a386e3aebb
2 changed files with 5 additions and 3 deletions

View File

@@ -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'])