A GitHub Action that automatically posts notifications to Slack or Discord channels when GitHub issues meet certain criteria.
- New Issue Notifications: Get notified when new issues are created with specific keywords or labels
- Engagement Thresholds: Receive alerts when issues reach certain reaction or comment counts
- Batch Checking: Periodically check all open issues for thresholds (perfect for reactions!)
- Flexible Filtering: Filter issues by title keywords, required labels, or excluded labels
- Multi-Platform Support: Send notifications to both Slack and Discord
- Customizable Messages: Use custom message templates with placeholders
- Go to your Slack workspace
- Create a new app or use an existing one
- Enable "Incoming Webhooks"
- Create a webhook for your desired channel
- Copy the webhook URL
- Go to your Discord server
- Edit a channel β Integrations β Webhooks
- Create a new webhook
- Copy the webhook URL
Go to your repository β Settings β Secrets and variables β Actions, and add:
SLACK_WEBHOOK_URL(your Slack webhook URL)DISCORD_WEBHOOK_URL(your Discord webhook URL)
Create .github/workflows/issue-notifications.yml:
name: Issue Notifications
on:
issues:
types: [opened, edited]
issue_comment:
types: [created]
# Optional: Add batch checking for reactions
schedule:
- cron: "0 * * * *" # Every hour
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Issue Notification Action
uses: your-username/github-action-issue-ack@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
title_keywords: "urgent,security,bug"
excluded_labels: "acknowledged"
reaction_threshold: "5"
comment_threshold: "3"
# Enable batch checking for reactions
check_all_open_issues: "true"| Input | Description | Required | Default |
|---|---|---|---|
slack_webhook_url |
Slack webhook URL | No | - |
discord_webhook_url |
Discord webhook URL | No | - |
| Input | Description | Required | Default |
|---|---|---|---|
title_keywords |
Comma-separated keywords to filter issues by title | No | - |
required_labels |
Comma-separated labels that must be present | No | - |
excluded_labels |
Comma-separated labels that should exclude the issue | No | - |
| Input | Description | Required | Default |
|---|---|---|---|
reaction_threshold |
Minimum reactions to trigger notification | No | 5 |
comment_threshold |
Minimum comments to trigger notification | No | 3 |
| Input | Description | Required | Default |
|---|---|---|---|
message_template |
Custom message template with placeholders | No | See below |
new_issue_prefix |
Prefix for new issue notifications | No | π New issue created on {repo_link}! |
threshold_prefix |
Prefix for threshold notifications | No | π¨ High-engagement issue detected on {repo_link}! |
| Input | Description | Required | Default |
|---|---|---|---|
notify_on_create |
Send notification when new issue is created | No | true |
notify_on_threshold |
Send notification when thresholds are met | No | true |
| Input | Description | Required | Default |
|---|---|---|---|
check_all_open_issues |
Check all open issues for thresholds when action runs | No | false |
max_issues_to_check |
Maximum number of issues to check during batch processing | No | 100 |
issue_state |
Which issues to check (open, closed, all) | No | open |
You can customize the notification message using these placeholders:
{title}- Issue title{url}- Issue URL{author}- Issue author username{reactions}- Number of reactions{comments}- Number of comments{repo}- Repository name (owner/repo){repo_name}- Repository name only (without owner){repo_url}- Repository URL{repo_link}- Repository name as hyperlink repo{created_minutes_ago}- Minutes since issue was created{created_hours_ago}- Hours since issue was created{created_days_ago}- Days since issue was created{created_at}- Original creation timestamp{created_ago}- Smart time format (e.g., "2 hours ago", "3 days ago")
π¨ High-engagement issue detected!
**{title}**
By: {author}
Reactions: {reactions} | Comments: {comments}
Repository: {repo_link}
Created: {created_hours_ago} hours ago
{url}
Notify on urgent issues with 3+ reactions:
- uses: your-username/github-action-issue-ack@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
title_keywords: "urgent,security"
reaction_threshold: "3"Notify on high-priority bugs with custom message:
- uses: your-username/github-action-issue-ack@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
title_keywords: "bug,crash,error"
required_labels: "high-priority,needs-attention"
excluded_labels: "wontfix,duplicate"
message_template: |
π Bug Alert!
**{title}**
Reported by: {author}
Engagement: {reactions} reactions, {comments} comments
{url}Since reactions don't trigger GitHub events, use batch checking to catch them:
name: Issue Notifications with Batch Checking
on:
issues:
types: [opened, edited]
issue_comment:
types: [created]
schedule:
- cron: "0 * * * *" # Every hour
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Issue Notification Action
uses: your-username/github-action-issue-ack@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
title_keywords: "urgent,security"
reaction_threshold: "5"
comment_threshold: "3"
check_all_open_issues: "true"
max_issues_to_check: "50"Check all open issues periodically without real-time events:
name: Batch Check Only
on:
schedule:
- cron: "*/30 * * * *" # Every 30 minutes
jobs:
check-issues:
runs-on: ubuntu-latest
steps:
- name: Issue Notification Action
uses: your-username/github-action-issue-ack@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
notify_on_create: "false"
notify_on_threshold: "true"
check_all_open_issues: "true"
reaction_threshold: "3"
comment_threshold: "2"You can customize the notification messages using placeholders:
- uses: your-username/github-action-issue-ack@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
title_keywords: "bug,crash,error"
required_labels: "high-priority,needs-attention"
excluded_labels: "wontfix,duplicate"
message_template: |
π Bug Alert!
**{title}**
Reported by: {author}
Engagement: {reactions} reactions, {comments} comments
Age: {created_days_ago} days, {created_hours_ago} hours old
{url}
new_issue_prefix: "π New bug reported on {repo_link}!"
threshold_prefix: "π¨ High-engagement bug on {repo_link}!"# Show age in different formats
message_template: |
**{title}**
Created: {created_minutes_ago} minutes ago
Age: {created_hours_ago} hours, {created_days_ago} days
{url}
# Only show if issue is older than 1 hour
message_template: |
**{title}** ({created_hours_ago}h old)
{url}The action responds to these GitHub events:
issues.opened: New issue createdissues.edited: Issue edited (checks thresholds)issue_comment.created: New comment added (checks thresholds)schedule: Periodic batch checking (when enabled)
GitHub doesn't provide webhook events for:
- Reactions added/removed - No webhook events
- Reaction count changes - No real-time notifications
The batch checking feature solves this by:
- β Checking all open issues periodically
- β Catching reaction thresholds that would otherwise be missed
- β Configurable intervals (every 30 minutes, hour, etc.)
- β Efficient pagination to handle large repositories
npm install
npm run buildnpm test- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.