whatisgithub

What is incident-ci?

balyakin/incident-ci — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · ops devopsComplexity · 2/5Setup · easy

In one sentence

A CLI and GitHub Action that blocks pull requests about production incidents from merging unless they include a valid, structured Incident Card file.

Mindmap

mindmap
  root((repo))
    What it does
      Validates Incident Cards
      Blocks PRs missing a card
      Reports via SARIF
    Tech stack
      Python
      Pydantic
      GitHub Actions
    Use cases
      Enforce incident records
      Annotate PR failures
      Gate merges by label
    Audience
      DevOps teams
      SRE and on call
      Platform engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a GitHub Actions workflow that fails a PR when an incident label is set but no valid Incident Card is included.

USE CASE 2

Validate an Incident Card file locally before pushing it in a pull request.

USE CASE 3

Get inline GitHub code scanning annotations pointing at the exact invalid line in an Incident Card.

USE CASE 4

Configure which services and labels are allowed so validation matches a team's own incident process.

What is it built with?

PythonPydanticGitHub ActionsYAML

How does it compare?

balyakin/incident-ci0xhassaan/nn-from-scratch3ks/embedoc
Stars00
LanguagePythonPythonPython
Last pushed2023-06-08
MaintenanceDormant
Setup difficultyeasymoderatehard
Complexity2/54/51/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires Python 3.12 and the uv package manager, add a .incident-ci.yaml config to define required labels and allowed services.

No license information is provided in the README.

So what is it?

This project is a small command line tool and GitHub Action that enforces one rule: if a pull request is about a production incident, it must include a properly filled out Incident Card before it can be merged. An Incident Card is a Markdown file that contains a single YAML block describing the incident, things like its id, severity, which service was affected, who is the commander, when it was detected, mitigated, and resolved, and links to logs. Rather than tracking this information in Slack threads or a PR description where it is easy to skip and hard to review, the tool keeps the record inside the repository itself, so it gets reviewed and diffed the same way as code. In a pull request, the tool can look at which files changed and which labels are on the PR to decide whether an Incident Card is actually required. If a required label like "incident" is missing, the check passes without demanding a card. If the label is present but no valid card was added or updated, the check fails. Results can be printed as plain text, JSON, or a SARIF report, and the SARIF format is designed to plug into GitHub's code scanning feature so problems show up as annotations directly on the file and line that failed. The validation rules go beyond just checking that a YAML block exists. They check field types, timestamp ordering, and required text lengths, and they enforce extra conditions depending on severity, for example high and critical incidents must name a commander and describe impact, and critical incidents must include a link to logs. The service named in the card must also be one of the values allowed in a project's own configuration file. The repository includes a ready to use GitHub Actions workflow file that runs this check automatically whenever a pull request is opened, edited, or has its labels changed, and uploads the SARIF report so failures appear as inline GitHub annotations. The author describes this as an intentionally minimal first version: a stateless command line tool and composite GitHub Action, with no web interface, API server, database, or background worker. It targets Python 3.12 and its own test suite requires at least 90 percent coverage.

Copy-paste prompts

Prompt 1
Write a .incident-ci.yaml config for this repo that requires the label incident and allows only the services checkout-api and search-api.
Prompt 2
Using the schema shown in this repo's README, write a valid Incident Card for a critical outage of a service called billing-api.
Prompt 3
Explain what exit code 65 versus 78 means in this repo's CLI, based on the exit code table in the README.
Prompt 4
Adapt the GitHub Actions workflow in this repo so it also runs on push to main, not just pull requests.

Frequently asked questions

What is incident-ci?

A CLI and GitHub Action that blocks pull requests about production incidents from merging unless they include a valid, structured Incident Card file.

What language is incident-ci written in?

Mainly Python. The stack also includes Python, Pydantic, GitHub Actions.

What license does incident-ci use?

No license information is provided in the README.

How hard is incident-ci to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is incident-ci for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.