Automatically create Incident.io incidents when Buildkite jobs fail.
- 🚨 Automatic incident creation when jobs fail
- 📝 Customizable incident details - include custom details to your incident summary
- 🔗 Buildkite annotations - creates annotations with direct links to Incident.io incidents
- 🔑 Secure credential handling - uses environment variables for api keys
- ⚙️ Customizable severity levels - choose whichever severity have been defined in your Incident.io account
The Incident.io API key for your organization to utilise Incident.io's API.
If you need to create one, follow Incident.io's guide to create your first incident using API. Use your preferred secret management method to store the key securely.
secrets:
- INCIDENTIO_API_KEY # Retrieve Buildkite Secrets created using Buildkite Interface
steps:
# OR use Buildkite Secrets plugin to retrieve your key
- label: "🔐 Fetch Incident.io Credentials"
key: "fetch-incidentio-secrets"
plugins:
- secrets#v1.0.2:
env:
INCIDENTIO_API_KEY: incidentio-api-key
command: "./run-tests.sh"
Your Incident.io severity name. Possible severity names in your Incident.io organisation: SEV-5, SEV-1, etc
A brief explanation of the incident. If not provided, Incident.io will auto generate a random name for your incident.
Detailed description of the incident. If not provided, the incident will be created without a summary.
Whether the incident should be open to anyone in your Slack workspace (public), or invite-only (private). If not provided, the incident will be created with the default channel mode.
Options: public, private
Default: public
steps:
- label: "🧪 Tests"
command: "./run-tests.sh"
plugins:
- secrets#v1.0.0:
env:
INCIDENTIO_API_KEY: incidentio-api-key
- incidentio#v1.0.0:
severity-name: "SEV-1"
incident-name: "Test Incident"
incident-summary: "CI tests have failed"- Hook Execution: The plugin runs as a
post-commandhook at the end of your command - Failure Detection: Checks the current command's exit status to determine if there's a failure
- Incident Creation: If a failure is detected, send a POST request to Incident.io's Create Incidents v2 API
- Annotation: Creates a Buildkite annotation with incident details and a direct link to the Incident.io incident
- Bash
curl(for API calls)jq(for JSON parsing)- Incident.io API key
- Buildkite agent with access to make HTTPS requests to
api.incident.io
| Elastic Stack | Agent Stack K8s | Hosted (Mac) | Hosted (Linux) | Notes |
|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | Requires curl and jq |
- ✅ Fully supported
⚠️ Partially supported- ❌ Not supported
- Follow the patterns established in this template
- Add tests for new functionality
- Update documentation for any new options
- Ensure shellcheck passes (fix issues, don't just disable checks - disabling should be done very seldomly and with team documentation/agreement)
- Test with the plugin tester
Run all tests:
docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-testerValidate plugin structure:
# Replace 'your-plugin-name' with your actual plugin name
docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-linter --id your-plugin-name --path /pluginRun shellcheck:
shellcheck hooks/* tests/* lib/*.bash lib/modules/* lib/providers/*The package is available as open source under the terms of the MIT License.