Postil

Bitbucket

Postil reviews Bitbucket pull requests through the same engine it uses for GitHub and GitLab. Support is best effort: shipped, tested, and configured with the same token-plus-base-URL pattern as every other forge. The hosted app does not reach Bitbucket; you run the CLI in your own pipeline with your own inference key.

1. Create credentials

Set BITBUCKET_TOKEN. Bitbucket Cloud repository, project, or workspace access tokens work directly; if you are using an app password instead, also set BITBUCKET_USER so the token is sent as basic auth rather than a bearer token. Add your inference key as MODEL_API_KEY and mirror it to POSTIL_API_KEY for pinned CLI compatibility.

2. Add the pipeline step

pipelines:
  pull-requests:
    '**':
      - step:
          name: postil review
          image: debian:bookworm-slim
          script:
            - apt-get update && apt-get install -y curl ca-certificates
            - curl -fsSL https://postil.dev/install.sh | sh
            - export PATH="$HOME/.local/bin:$PATH"
            - export POSTIL_API_KEY="$MODEL_API_KEY"
            - postil review --forge bitbucket
                --repo $BITBUCKET_WORKSPACE/$BITBUCKET_REPO_SLUG
                --pr $BITBUCKET_PR_ID

A gate-failing review exits 1 and fails the step; a clean review exits 0 and posts nothing; see exit codes. Mark the step required in the repository's branch restrictions to make the gate binding.

3. Bitbucket Data Center

For self-hosted Bitbucket Data Center, point the CLI at your instance with BITBUCKET_API_URL:

export BITBUCKET_TOKEN=...
export MODEL_API_KEY=...
export POSTIL_API_KEY="$MODEL_API_KEY"
export BITBUCKET_API_URL=https://bitbucket.example.com/rest/api/1.0
postil review --forge bitbucket --repo project/repo --pr 7

Local review against a Bitbucket PR

export BITBUCKET_TOKEN=...          # set BITBUCKET_USER too for an app password
export MODEL_API_KEY=...
export POSTIL_API_KEY="$MODEL_API_KEY"
postil review --forge bitbucket --repo workspace/repo --pr 7

Parity and limits

  • Same gate thresholds, envelope schema, and exit codes as every other forge; see the CLI reference and exit codes.
  • postil respond (the @postil interactive bot) supports --pr only. Bitbucket's issue tracker is a separate, often-disabled product with a different API shape Postil does not talk to yet; pointing respond at --issue on Bitbucket returns an error rather than silently doing nothing.
  • The hosted Postil app is GitHub-only today; on Bitbucket you run the CLI in your own pipeline.
  • See the forges overview for GitHub, GitLab, and Azure DevOps.