Skip to main content

🚀 Beta: All Pro and Team features are free. Install on GitHub →

Bitbucket Pipelines

CodeRifts for Bitbucket — API Governance on Every Pull Request

Add the CodeRifts pipe to your bitbucket-pipelines.yml and catch breaking API changes before they reach production. Three steps, five minutes.

Setup in 3 Steps

No native app to install. Just add the pipe to your pipeline.

1

Get a free API key

Sign up at app.coderifts.com/api/signup to get your API key.

2

Add CODERIFTS_API_KEY as a repository variable

Go to Repository settings → Pipelines → Repository variables and add the key as a secured variable.

3

Add the pipe to bitbucket-pipelines.yml

pipelines:
  pull-requests:
    '**':
      - step:
          name: API Governance
          script:
            - pipe: docker://coderifts/bitbucket-pipe:latest
              variables:
                CODERIFTS_API_KEY: $CODERIFTS_API_KEY
                FAIL_ON_BREAKING: 'true'

Every Pull Request will now run a CodeRifts check automatically.

What It Does

On every Pull Request, CodeRifts analyzes your OpenAPI specs and reports:

Breaking Changes

Detects 10 types of breaking changes: endpoint removals, type changes, required field additions, and more.

Risk Scoring

Calculates a 0–100 risk score across 4 dimensions so you know exactly how dangerous a change is.

Policy Enforcement

Checks policy violations from your .coderifts.yml — breaking budgets, freeze windows, no-delete rules.

Security Analysis

Catches auth regressions, sensitive field exposure, and security-critical schema changes.

Alternative: Use the REST API Directly

If you prefer to call the API directly instead of using the pipe:

# bitbucket-pipelines.yml
pipelines:
  pull-requests:
    '**':
      - step:
          name: API Contract Check
          image: curlimages/curl:latest
          script:
            - |
              RESULT=$(curl -sf -X POST \
                https://app.coderifts.com/api/diff \
                -H "Authorization: Bearer $CODERIFTS_API_KEY" \
                -H "Content-Type: application/json" \
                -d '{ "base": "api/openapi.yaml", "head": "api/openapi.yaml" }')
              echo "$RESULT" | python3 -m json.tool
              BREAKING=$(echo "$RESULT" | python3 -c \
                "import sys,json; print(json.load(sys.stdin).get('summary',{}).get('breaking',0))")
              if [ "$BREAKING" -gt 0 ]; then
                echo "ERROR: $BREAKING breaking change(s) detected"
                exit 1
              fi

See the REST API documentation for full details.

Start protecting your APIs in Bitbucket today.

Add the pipe, get your free API key, and catch breaking changes on every Pull Request.