Posts a message to Slack via a Webhook.
(title: str, details: str)
| 26 | |
| 27 | |
| 28 | def 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 |
no outgoing calls
no test coverage detected