Send a notification to a Slack channel.
(webhook_url, library_name, version, release_info)
| 50 | |
| 51 | |
| 52 | def notify_slack(webhook_url, library_name, version, release_info): |
| 53 | """Send a notification to a Slack channel.""" |
| 54 | message = ( |
| 55 | f"🚀 New release for {library_name} available: version **{version}** 🎉\n" |
| 56 | f"📜 Release Notes: {release_info['url']}\n" |
| 57 | f"⏱️ Release time: {release_info['release_time']}" |
| 58 | ) |
| 59 | payload = {"text": message} |
| 60 | response = requests.post(webhook_url, json=payload) |
| 61 | |
| 62 | if response.status_code == 200: |
| 63 | print("Notification sent to Slack successfully.") |
| 64 | else: |
| 65 | print("Failed to send notification to Slack.") |
| 66 | |
| 67 | |
| 68 | def main(): |
no outgoing calls
no test coverage detected
searching dependent graphs…