MCPcopy Create free account
hub / github.com/firebase/functions-samples / post_to_slack

Function post_to_slack

Python/testlab-to-slack/functions/main.py:28–39  ·  view source on GitHub ↗

Posts a message to Slack via a Webhook.

(title: str, details: str)

Source from the content-addressed store, hash-verified

26
27
28def post_to_slack(title: str, details: str) -> requests.Response:
29 """Posts a message to Slack via a Webhook."""
30 return requests.post(
31 SLACK_WEBHOOK_URL.value,
32 json={
33 "blocks": [
34 {"type": "section", "text": {"type": "mrkdwn", "text": title}},
35 {"type": "divider"},
36 {"type": "section", "text": {"type": "mrkdwn", "text": details}},
37 ]
38 },
39 )
40# [END postToSlack]
41
42

Callers 1

posttestresultstoslackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected