MCPcopy Create free account
hub / github.com/dashezup/github-webhook-to-telegram / _format_push

Function _format_push

utils/github_webhook.py:156–169  ·  view source on GitHub ↗
(payload: dict)

Source from the content-addressed store, hash-verified

154
155
156async def _format_push(payload: dict) -> str:
157 ref = [f"\u2192 {payload['ref']}"]
158 commits = payload['commits']
159 commits_list = [
160 "\u2192 "
161 "<code>{name}</code> {message} [<a href=\"{url}\">{cid}</a>]".format(
162 name=commit['author']['username'],
163 message=escape(commit['message']),
164 url=commit['url'],
165 cid=commit['id'][:7]
166 )
167 for commit in commits
168 ]
169 return "\n".join(ref + commits_list)
170
171
172async def _format_star(payload: dict) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected