Skip to content

Latest commit

 

History

History

README.md

Workflow Samples

This directory contains real-world workflow examples demonstrating different use cases for the incident.io GitHub Action. These workflows have been tested and validated in production scenarios.

Available Examples

1. CI Pipeline Monitoring

alert-ci-failures.yml

Monitors your CI pipeline and automatically creates alerts when builds fail.

Key features:

  • Triggers on workflow completion
  • Creates alerts for failures
  • Automatically resolves alerts when CI succeeds again
  • Includes deduplication to prevent alert spam

Use this when:

  • You want to track CI health across your repositories
  • You need to be notified when builds break on important branches
  • You want automatic resolution when issues are fixed

2. Critical Pull Request Alerts

alert-critical-pr.yml

Creates high-priority alerts when PRs are labeled as critical, hotfix, urgent, or security.

Key features:

  • Triggers on PR label events
  • Supports multiple criticality labels
  • Automatically resolves when PR is closed
  • Includes PR metadata in custom fields

Use this when:

  • Critical PRs need immediate review to unblock production
  • Security fixes require urgent attention
  • You want SLA tracking for important code reviews

3. Production Deployment Monitoring

deployment.yml

Alerts on production deployment failures with critical severity.

Key features:

  • Full deployment workflow with build steps
  • Critical alerts for production failures only
  • Automatic resolution on successful deployments
  • Includes rollback guidance

Use this when:

  • You deploy to production and need immediate failure alerts
  • You want to track deployment success rates
  • You need automated incident creation for failed deployments

4. Custom Business Logic

custom-health-check.yml

Demonstrates integrating custom scripts and business logic with incident.io alerts.

Key features:

  • Scheduled or manual trigger
  • Custom script integration
  • Dynamic alert content from script outputs
  • Suitable for data quality checks, health monitoring, etc.

Use this when:

  • You have custom monitoring or validation scripts
  • You need scheduled health checks
  • You want to integrate business-specific logic with incident management

Using These Samples

  1. Copy the workflow file to .github/workflows/ in your repository
  2. Configure the required secrets:
    • INCIDENT_IO_API_KEY - Your incident.io API key
    • INCIDENT_IO_ALERT_SOURCE_ID - Your alert source ID
  3. Customize the workflow for your specific needs:
    • Update custom-fields with your service/team names
    • Adjust severity levels based on your requirements
    • Modify deduplication keys to match your workflow patterns
  4. Test using manual triggers (workflow_dispatch) before relying on automated triggers

Customization Tips

Custom Fields

Update the custom-fields section in each workflow to match your incident.io catalog:

custom-fields: |
  {
    "service": "your-service-name",
    "team": "your-team-name",
    "environment": "production"
  }

These fields enable incident.io to route alerts to the correct teams and services.

Deduplication Keys

Adjust deduplication keys to control alert grouping:

# Per repository and branch
deduplication-key: "ci-failure-${{ github.repository }}-${{ github.ref }}"

# Per environment
deduplication-key: "deploy-${{ inputs.environment }}"

# Per specific resource
deduplication-key: "check-${{ github.repository }}-${{ matrix.check_type }}"

Severity Levels

Choose appropriate severity levels for your organization:

  • critical - Production down, requires immediate response
  • error - Important failures, deployment issues
  • warning - Non-blocking issues, flaky tests
  • info - Informational events, successful completions

Testing

All these workflows support manual triggering via workflow_dispatch. Use the Actions tab in GitHub to test them before enabling automated triggers.

More Examples

For additional patterns and advanced use cases, see the main Readme.