Spaces:
Runtime error
A newer version of the Gradio SDK is available:
5.49.1
π€ Telegram Bot Setup for GitHub Actions
This guide will help you set up Telegram notifications for your GitHub Actions workflow.
π± Step 1: Get Your Chat ID
Start a conversation with your bot:
- Go to: https://t.me/Dual_Mode_Mood_bot
- Click "START" or send any message like "Hello"
Get your Chat ID:
# In your Codespaces terminal python3 telegram_notifier.py get-chat-id
Copy the Chat ID (it will be a number like
123456789
)
π Step 2: Add Secrets to GitHub Repository
Go to your GitHub repository
Click "Settings" β "Secrets and variables" β "Actions"
Click "New repository secret"
Add these secrets:
Secret Name Value Description TELEGRAM_CHAT_ID
123456789
Your chat ID from step 1 HF_USERNAME
your_hf_username
Your Hugging Face username HF_TOKEN
your_hf_token
Your Hugging Face token HF_SPACE_NAME
your_space_name
Your Hugging Face Space name
π§ͺ Step 3: Test the Integration
Test locally first:
# Set your chat ID export TELEGRAM_CHAT_ID="your_chat_id_here" # Test sending a message python3 telegram_notifier.py
Test with GitHub Actions:
- Make a small change to any file
- Commit and push to main branch
- Check your Telegram for notifications!
π What You'll Receive
When GitHub Actions run, you'll get messages like:
β Success Notification:
π GitHub Action Update
β
Status: SUCCESS
π Workflow: Test & Sync to Hugging Face
β° Time: 2024-01-15 14:30:25 UTC
π€ Actor: your-username
π Commit: Fixed API output formatting
π Repository: your-username/hugging_face_mood_app
MLOps Case Study - Mood Analysis App
β Failure Notification:
π GitHub Action Update
β Status: FAILED
π Workflow: Test & Sync to Hugging Face
β° Time: 2024-01-15 14:30:25 UTC
π€ Actor: your-username
π Commit: Added new feature
π Repository: your-username/hugging_face_mood_app
MLOps Case Study - Mood Analysis App
π§ Troubleshooting
Bot not responding?
- Make sure you've sent a message to the bot first
- Check that your Chat ID is correct
- Verify the bot token is correct
Notifications not working?
- Check that
TELEGRAM_CHAT_ID
secret is set in GitHub - Look at the GitHub Actions logs for error messages
- Test the bot locally first
Bot token security?
- The bot token is visible in the code (for simplicity)
- In production, you should store it as a GitHub secret
- The token only allows sending messages to your specific chat
π― Extra Credit Features
This implementation includes several enhancements beyond the basic requirement:
- Rich formatting with HTML and emojis
- Detailed information including commit message, actor, timestamp
- Both success and failure notifications
- Easy setup script for getting chat ID
- Error handling and fallback messages
- Professional formatting with project branding
π Ready to Go!
Once you've completed these steps, every time you push to the main branch, you'll get a Telegram notification about your GitHub Actions status!
This gives you real-time feedback on your MLOps pipeline and demonstrates advanced automation skills for your case study.