(args)
| 27 | |
| 28 | |
| 29 | def main(args): |
| 30 | action_url = f"https://github.com/{GITHUB_REPO}/actions/runs/{GITHUB_RUN_ID}" |
| 31 | if args.status == "success": |
| 32 | hub_path = f"https://huggingface.co/datasets/diffusers/community-pipelines-mirror/tree/main/{PATH_IN_REPO}" |
| 33 | message = ( |
| 34 | "✅ Community pipelines successfully mirrored.\n" |
| 35 | f"🕸️ GitHub Action URL: {action_url}.\n" |
| 36 | f"🤗 Hub location: {hub_path}." |
| 37 | ) |
| 38 | else: |
| 39 | message = f"❌ Something wrong happened. Check out the GitHub Action to know more: {action_url}." |
| 40 | |
| 41 | payload = {"text": message} |
| 42 | response = requests.post(SLACK_WEBHOOK_URL, json=payload) |
| 43 | |
| 44 | if response.status_code == 200: |
| 45 | print("Notification sent to Slack successfully.") |
| 46 | else: |
| 47 | print("Failed to send notification to Slack.") |
| 48 | |
| 49 | |
| 50 | if __name__ == "__main__": |
no outgoing calls
no test coverage detected