This GitHub Action automatically notifies a Slack channel when:
- Critical Dependabot vulnerability alerts are detected
- Secret Scanning alerts are found (all considered critical)
- On a scheduled basis (every Monday) to provide a summary of critical alerts
- When new critical security events are detected after a push
- Go to Slack API Apps
- Click "Create New App" → "From scratch"
- Give your app a name and select your workspace
- Click "Incoming Webhooks" and activate the feature
- Click "Add New Webhook to Workspace"
- Select the channel where you want to receive notifications
- Copy the Webhook URL
- In your GitHub repository, go to Settings → Secrets → Actions
- Click "New repository secret"
- Name:
SLACK_WEBHOOK_URL
- Value: Paste the webhook URL you copied from Slack
- Click "Add secret"
For this workflow to access Dependabot and secret scanning alerts:
-
Make sure GitHub Advanced Security is enabled for your repository
- Go to Settings → Security & analysis
- Enable Dependabot alerts and Secret scanning
-
Ensure the workflow has appropriate permissions
- The workflow uses
GITHUB_TOKEN
which should have read access to security events by default
- The workflow uses
The workflow will:
-
Trigger on:
- Scheduled runs (every Monday at 9:00 AM UTC)
- Manual triggers (workflow_dispatch)
- Push events to detect new security issues
-
Collect only critical alerts from:
- Dependabot vulnerability alerts (severity: critical)
- Secret scanning (all considered critical)
-
Format and send the alerts to your specified Slack channel
This workflow focuses only on critical security issues, ensuring that:
- You're not overwhelmed with non-critical alerts
- Your team can respond quickly to the most important security issues
- Secret leaks and critical vulnerabilities get immediate attention
You can customize this workflow by:
- Changing the schedule in the
cron
expression - Modifying the Slack message format in the
payload
section - Adding additional event triggers as needed
If you're not receiving notifications:
- Check that your Slack webhook URL is correctly configured in the repository secrets
- Verify that GitHub Advanced Security features are enabled for your repository
- Check the workflow run logs for any errors that might indicate permission issues