DEV Community

Turya Kalburgi
Turya Kalburgi

Posted on

How I built a lightweight GitHub Action to stop breaking API changes in CI

Breaking API contracts silently slipping into production is a pain point almost every engineering team hits eventually. A backend PR renames a field, drops a property, or mutates a type—and downstream services or frontends immediately break.

To catch this before merges happen, I built API Drift Sentinel—a zero-config GitHub Action that detects breaking OpenAPI/Swagger schema changes directly in your PR workflows.

Why not existing tools?

Most existing solutions either require heavy external cloud platforms or demand installing full Node/Python runtimes during the CI run.

I wanted something drop-in and ultra-fast:

  • Zero config: Works out of the box for standard OpenAPI 3.0 / Swagger specs.
  • Fail-fast: Exits with code 1 and emits inline GitHub PR annotations whenever breaking changes are caught.
  • Pre-bundled with esbuild: Bundled down to a standalone script, running in ~50ms without an npm install step on your runner.

How to use it

Add this step to your GitHub Actions workflow (e.g., .github/workflows/ci.yml):


yaml
- name: Check for Breaking API Changes
  uses: Turya-Kalburgi/api-drift-sentinel@v1
  with:
    base-spec: 'openapi.yaml'


Enter fullscreen mode Exit fullscreen mode

Top comments (0)