Skip to navigation

Bitbucket Integration

Bitbucket Integration

Integrate GovernanceAI with Bitbucket Cloud or Server for automated AI governance scanning.

Bitbucket Cloud Setup

Step 1: Create OAuth Consumer

  • Bitbucket Cloud → Workspace Settings → OAuth consumers
  • Create consumer with scopes:
    • repository:read
    • pullrequest:read
  • Copy Client ID and Secret

Step 2: Connect in GovernanceAI

  • Integrations → Bitbucket Cloud
  • Click Connect
  • Authorize GovernanceAI
  • Select repositories

Bitbucket Server/Data Center Setup

Step 1: Create App Password

  • Personal Settings → App passwords
  • Create password with permissions:
    • repository:read
    • pullrequest:read
  • Copy credentials

Step 2: Connect in GovernanceAI

  • Integrations → Bitbucket Server
  • Enter Server URL
  • Enter username and password
  • Select repositories

Scanning Features

✅ Automatic Scanning

  • On push to main branches
  • On pull requests
  • Scheduled scans

✅ PR Integration

  • Findings in PR comments
  • Build status checks
  • Block on critical findings

Bitbucket Pipelines Integration

# bitbucket-pipelines.yml
image: atlassian/default-image:2
pipelines:
branches:
main:
- step:
name: GovernanceAI Scan
script:
- |
curl -X POST https://api.governanceai.com/v1/scans \
-H "Authorization: Bearer $GOVERNANCEAI_API_KEY" \
-d '{
"repository": "'$BITBUCKET_REPO_FULL_NAME'",
"ref": "'$BITBUCKET_COMMIT'"
}'

Cloud vs Server

FeatureCloudServer
SetupOAuthApp Password
WebhooksAutomaticManual
ComplexitySimpleMore steps
Self-hostedNoYes

Troubleshooting

  • OAuth timeout - Check network connectivity
  • Repositories not showing - Verify permissions
  • Webhooks not firing - Check webhook delivery in Bitbucket
  • Build status not updating - Verify build permission

Next Steps