Note
This is an unofficial, community-created GitHub Action and is not affiliated with, endorsed by, or supported by incident.io. incident.io and its associated trademarks are property of Pineapple Technology Ltd.
Send alerts to incident.io from your GitHub Actions workflows using the Alert Events V2 API. This action automatically enriches alerts with GitHub workflow context, enabling seamless integration between your CI/CD pipeline and incident management.
Learn how to send your first alert to incident.io from a GitHub Actions workflow.
- An incident.io account
- A GitHub repository with Actions enabled
- 10 minutes
- Log in to your incident.io dashboard
- Navigate to Settings → Alert Sources
- Click Create Alert Source and select HTTP
- Give it a name (e.g., "GitHub Actions")
- Save and note the Alert Source Config ID and Token
- Go to your GitHub repository
- Navigate to Settings → Secrets and variables → Actions
- Add two new repository secrets:
INCIDENT_IO_TOKEN
: Your alert source tokenINCIDENT_IO_ALERT_SOURCE_ID
: Your alert source config ID
Create .github/workflows/alert-on-failure.yml
:
name: Alert on Failure
on:
push:
branches: [main]
jobs:
example-job:
runs-on: ubuntu-latest
steps:
- name: Simulate failure
run: exit 1
continue-on-error: true
- name: Send alert to incident.io
if: failure()
uses: lowlydba/incident-io-action@v1
with:
incident-io-token: ${{ secrets.INCIDENT_IO_TOKEN }}
alert-source-config-id: ${{ secrets.INCIDENT_IO_ALERT_SOURCE_ID }}
title: 'Workflow Failed'
status: 'firing'
description: 'The main workflow has failed.'
- Commit and push the workflow file
- Watch the workflow run in the Actions tab
- Check your incident.io dashboard for the alert
🎉 Congratulations! You've sent your first alert from GitHub Actions to incident.io.
Practical guides for common tasks.
Monitor your deployment workflows and send alerts when they fail:
name: Production Deploy
on:
workflow_run:
workflows: ['Deploy to Production']
types: [completed]
jobs:
alert-on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Send deployment failure alert
uses: lowlydba/incident-io-action@v1
with:
incident-io-token: ${{ secrets.INCIDENT_IO_TOKEN }}
alert-source-config-id: ${{ secrets.INCIDENT_IO_ALERT_SOURCE_ID }}
title: 'Production Deployment Failed'
status: 'firing'
description: |
Deployment to production has failed.
Workflow: ${{ github.event.workflow_run.name }}
Commit: ${{ github.event.workflow_run.head_sha }}
Enrich alerts with additional context using the metadata
field:
- name: Send alert with custom data
uses: lowlydba/incident-io-action@v1
with:
incident-io-token: ${{ secrets.INCIDENT_IO_TOKEN }}
alert-source-config-id: ${{ secrets.INCIDENT_IO_ALERT_SOURCE_ID }}
title: 'High Error Rate Detected'
status: 'firing'
description: 'Error rate exceeded threshold'
metadata: |
{
"service": "api",
"environment": "production",
"error_rate": "5.2%",
"threshold": "1.0%",
"region": "us-east-1"
}
Send a "resolved" alert when an issue is fixed:
- name: Send firing alert
id: alert
uses: lowlydba/incident-io-action@v1
with:
incident-io-token: ${{ secrets.INCIDENT_IO_TOKEN }}
alert-source-config-id: ${{ secrets.INCIDENT_IO_ALERT_SOURCE_ID }}
title: 'Service Degradation'
status: 'firing'
- name: Wait for recovery
run: sleep 60
- name: Resolve alert
uses: lowlydba/incident-io-action@v1
with:
incident-io-token: ${{ secrets.INCIDENT_IO_TOKEN }}
alert-source-config-id: ${{ secrets.INCIDENT_IO_ALERT_SOURCE_ID }}
title: 'Service Recovered'
status: 'resolved'
deduplication-key: ${{ steps.alert.outputs.deduplication-key }}
Control alert grouping with custom deduplication keys:
- name: Send alert with custom key
uses: lowlydba/incident-io-action@v1
with:
incident-io-token: ${{ secrets.INCIDENT_IO_TOKEN }}
alert-source-config-id: ${{ secrets.INCIDENT_IO_ALERT_SOURCE_ID }}
title: 'Database Migration Failed'
status: 'firing'
deduplication-key: 'db-migration-${{ github.run_id }}'
Complete technical reference for the action.
Input | Description | Required | Default |
---|---|---|---|
incident-io-token |
incident.io API token for authentication | âś… | - |
alert-source-config-id |
The alert source config ID from incident.io | âś… | - |
title |
Title of the alert | âś… | - |
status |
Status of the alert (firing or resolved ) |
âś… | firing |
description |
Description with additional details (supports Markdown) | ❌ | - |
deduplication-key |
Unique deduplication key for this alert. Defaults to GitHub workflow run ID if not provided | ❌ | Run ID |
source-url |
Link to the alert source. Defaults to GitHub workflow run URL if not provided | ❌ | Run URL |
metadata |
Additional metadata as JSON string | ❌ | {} |
Output | Description |
---|---|
deduplication-key |
The deduplication key used for the alert |
response-status |
The response status from incident.io API |
The action automatically includes GitHub workflow context in alert metadata under
the github
key:
Field | Description |
---|---|
workflow |
Name of the workflow |
workflow_id |
Unique ID of the workflow run |
workflow_run_number |
Run number of the workflow |
workflow_attempt |
Attempt number if re-run |
job |
Name of the job |
actor |
User who triggered the workflow |
repository |
Repository name (owner/repository) |
ref |
Git reference (branch/tag) |
sha |
Commit SHA |
event_name |
Event that triggered the workflow |
This context is automatically merged with any custom metadata
you provide.
Problem: When CI/CD pipelines fail, teams need immediate visibility into the failure to respond quickly. While GitHub provides notifications, integrating with a dedicated incident management platform like incident.io provides better context, tracking, and collaboration.
Solution: This action bridges GitHub Actions and incident.io, automatically creating alerts enriched with workflow context, enabling teams to:
- 🎯 Centralize incident tracking and alert notifications across multiple systems
- 📢 Leverage incident.io's escalation and on-call features
- đź“‹ Maintain a single source of truth for incidents
- đź”— Correlate CI/CD failures with other system alerts
The action uses deduplication keys to group related alerts together. By default, each workflow run gets a unique key based on the GitHub run ID, preventing duplicate alerts for the same run.
Default behavior: Each workflow run creates a new alert
Workflow Run #123 → Alert with key "123"
Workflow Run #124 → Alert with key "124"
Custom keys: Use the same key to update an existing alert
Firing alert → deduplication-key: "db-migration-prod"
Resolved alert → deduplication-key: "db-migration-prod" (updates same alert)
Alerts in incident.io follow a lifecycle:
- Firing: An active issue that needs attention
- Resolved: The issue has been fixed
This action supports both statuses, allowing you to:
- 🚨 Create alerts when problems are detected (
status: firing
) - âś… Automatically resolve them when fixed (
status: resolved
)
The action automatically adds GitHub-specific metadata to every alert. This provides immediate context about:
- 📊 What happened: Workflow name and job
- 📍 Where it happened: Repository, branch, commit
- 👤 Who triggered it: Actor who initiated the workflow
- ⏰ When it happened: Run number and attempt
This enrichment happens automatically and is merged with any custom metadata you provide, ensuring you never lose important context.
Why require alert-source-config-id?
Each alert source in incident.io has unique routing, escalation, and grouping rules. Requiring this ID ensures alerts reach the correct team and follow the appropriate response procedures.
Why default to workflow run ID for deduplication?
Most use cases involve alerting on individual workflow failures. Using the run ID as a default prevents alert noise while still allowing customization for advanced scenarios.
Why automatically include GitHub context?
Manual context gathering is error-prone and tedious. Automatic enrichment ensures consistent, comprehensive information in every alert, improving response times and debugging.
Contributions are welcome! Please feel free to submit a Pull Request. Make sure to:
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
- Run
npm run all
before submitting
For development setup and guidelines, see the Copilot Instructions.
This project is licensed under the MIT License - see the LICENSE file for details.
This is an unofficial, community-created GitHub Action and is not affiliated with, endorsed by, or supported by Pineapple Technology Ltd. The incident.io name, logo, and related trademarks are property of Pineapple Technology Ltd.
This action uses the publicly available incident.io API as documented at api-docs.incident.io. Users of this action are responsible for complying with incident.io's Terms of Service and API usage policies.
The maintainers of this action are not responsible for any issues, damages, or service disruptions that may result from using this action. Use at your own risk.