Skip to Content
CI & GitHub

CI & GitHub

Block PRs that break API contracts. Stoney runs checks against your preview deployment and posts results to GitHub.


Setup

1. Connect GitHub

Go to Settings → Connections → GitHub and authorize Stoney.

2. Configure preview URL

Tell Stoney where your PR previews deploy:

PlatformPattern
Vercelhttps://{repo}-{branch}.vercel.app
Netlifyhttps://{branch}--{site}.netlify.app
RailwayCustom domain per branch
Customhttps://staging.yourapi.com

Set this in Settings → Connections → Preview URL.

3. Enable CI protection

In the Contracts tab, toggle CI Protected on contracts you want to enforce.


How It Works

PR opened → Stoney receives webhook → Runs contracts against preview → Posts check result to GitHub → PR blocked if contracts fail

What gets tested

Only contracts marked as CI Protected run on PRs. These are typically:

  • Stateless contracts — Auth checks (401 without token, 403 for wrong user)
  • Validation contracts — Bad input returns 400
  • Health checks/api/health returns 200

Shape contracts (learned from production) are not run in CI — they monitor production passively.


PR Check Results

Stoney posts a commit status to your PR:

✓ Stoney: 12 contracts passed

or

✗ Stoney: 1 contract failed

POST /api/orders expected 201, got 500

Click the details link to see full results in the Stoney dashboard.


Contract Tiers

TierRuns in CI?Description
StatelessNo auth needed — tests error handling
Auth boundaryUses test tokens to verify permissions
ShapePassive production monitoring only
DB checkSQL queries against your database

Troubleshooting

PR checks not running?

  • Verify GitHub is connected in Settings
  • Check that the webhook is registered (Settings → Connections)
  • Ensure at least one contract has CI Protected enabled

Checks failing unexpectedly?

  • Confirm preview URL is correct
  • Check if the preview deployment is ready when Stoney runs
  • Review the run details in the dashboard

Want to skip CI for a PR?

Add [skip stoney] to your commit message.

Last updated on