Skip to main content
MergeGuide integrates with Bitbucket Cloud to evaluate pull requests. When a PR is opened or updated, MergeGuide checks the changes against your policies and reports the result back on the pull request.

How it works

Once connected, MergeGuide listens for pull request events from your Bitbucket repository. On a relevant event it evaluates the changed code and posts the result to the PR. Blocking findings hold the merge until they’re resolved.

Connect Bitbucket

1

Add the repository in the dashboard

In portal.mergeguide.ai, open Repositories and connect your Bitbucket repository.
2

Configure the webhook

Add a webhook in your Bitbucket repository settings for pull request events, using the URL and secret MergeGuide provides. The secret is used to verify that webhook requests genuinely come from Bitbucket.
3

Open a pull request

Open or update a PR. MergeGuide evaluates the change and reports the result on the pull request.

Run in Bitbucket Pipelines

You can also run MergeGuide as a pipeline step. Install the CLI and run a check:
bitbucket-pipelines.yml
pipelines:
  pull-requests:
    '**':
      - step:
          name: MergeGuide policy check
          image: python:3.11
          script:
            - pip install mergeguide
            - mergeguide check . --fail-on-warning
See CI/CD patterns for the general pipeline recipe.

Block merges on findings

Require the MergeGuide check to pass before a PR can merge using Bitbucket’s merge checks in your repository settings. See Set up the PR gate.

Next steps

PR gate

Block merges on blocking findings.

CI/CD patterns

Wire MergeGuide into any pipeline.