Setup Overview
To enable email notifications, you need to:- Configure SMTP server settings
- Provide sender and recipient email addresses
- (Optional) Configure notification threshold
Email notifications are optional. If you don’t provide SMTP settings, the action will still generate reports but won’t send emails.
SMTP Configuration
Required SMTP Settings
Provide these inputs to enable email notifications:SMTP server hostname.
SMTP authentication username (usually your email address).
SMTP authentication password or app-specific password.
Recipient email address.
Optional SMTP Settings
SMTP server port.Common ports:
587- TLS/STARTTLS (recommended)465- SSL25- Unencrypted (not recommended)
Sender name or email address displayed in the “From” field.
Provider-Specific Setup
Gmail
For Gmail, you need to use an app-specific password:- Enable 2-factor authentication on your Google account
- Generate an app password at myaccount.google.com/apppasswords
- Use these settings:
Outlook / Office 365
SendGrid
AWS SES
Mailgun
Notification Thresholds
Control when notifications are sent based on star changes using thenotification-threshold option.
Threshold Options
- auto (Recommended)
- 0 (Always Notify)
- Fixed Number
Adaptive threshold based on your repository activity and history.The
auto mode intelligently determines when changes are significant enough to notify you, taking into account:- Total number of stars across your repositories
- Historical star change patterns
- Repository growth trends
Send on No Changes
By default, emails are only sent when star counts change. You can override this:- Emails are sent even when no stars have changed
- Useful for periodic status reports
- The report will indicate “no changes” in the summary
The
send-on-no-changes option is independent of notification-threshold. Even with a threshold, if no changes occur and this option is enabled, you’ll receive an email.Email Content
Emails include:- Subject line: Localized subject with total stars and change delta
- HTML report: Formatted report with:
- Summary of star changes
- Repository breakdown
- Star trend charts (if
include-charts: true) - New and removed repositories
- Individual repository trends
- New stargazers (if
track-stargazers: true) - Growth forecast
Subject Line Format
The email subject follows this pattern:locale setting:
- English:
GitHub Star Tracker Report: {total} ({delta}) - Spanish:
Informe de Seguimiento de Estrellas en GitHub: {total} ({delta}) - Catalan:
Informe de Seguiment d'Estrelles a GitHub: {total} ({delta}) - Italian:
Report Tracciamento Stelle GitHub: {total} ({delta})
Complete Examples
Basic Email Notifications
.github/workflows/star-tracker.yml
Advanced Notifications with Custom Threshold
.github/workflows/star-tracker.yml
Multiple Recipients (Using SendGrid)
For multiple recipients, you’ll need to use a service that supports comma-separated addresses or set up distribution lists:Troubleshooting
Email Not Sending
- Check credentials: Verify SMTP username and password are correct
- Check port: Ensure you’re using the correct port (587 for TLS)
- Check logs: Review the GitHub Actions logs for error messages
- Test SMTP: Use a tool like
telnetoropensslto test SMTP connectivity - App passwords: For Gmail and some providers, ensure you’re using app-specific passwords
Authentication Errors
- Gmail: Must use app password with 2FA enabled
- Office 365: May need to enable SMTP AUTH
- AWS SES: Must verify sending domain/email first
Notifications Not Triggering
If SMTP is working but you’re not receiving emails:- Check threshold: Your
notification-thresholdmight be too high - No changes: Enable
send-on-no-changes: trueto test - Check should-notify output: Review the action outputs in logs
Security Best Practices
- Use GitHub Secrets: Store all SMTP credentials as repository secrets
- Use app passwords: Enable 2FA and use app-specific passwords when available
- Limit token scope: Use the minimum required GitHub token scope
- Review access: Regularly review who has access to your secrets
- Rotate credentials: Periodically update SMTP passwords and tokens
Setting Up Secrets
- Go to your repository Settings > Secrets and variables > Actions
- Click “New repository secret”
- Add these secrets:
PAT_TOKEN- Your GitHub Personal Access TokenSMTP_USERNAME- Your SMTP usernameSMTP_PASSWORD- Your SMTP password or app password
Next Steps
Localization
Configure language preferences for email reports
Action Inputs
View all available configuration options