Bitbucket Premium: PR Gating Setup

Configure Bitbucket pull request scanning to publish scan results and comments for issues from Aikido. No pipeline code needed.

Set up Bitbucket PR Scanning

1

Create a Workspace Access Token

In Bitbucket, go to Workspace settings > Access tokens.

Select Create access token.

2

Give it the right access

Name the token (for example, AikidoSec). Set an expiry date that matches your rotation policy.

Enable these scopes:

  • Repositories: Read & Write

  • Pull Requests: Read & Write

  • Webhooks: Read & Write

  • Pipelines: Read & Write

3

Copy the access token

Copy the generated token. Paste it in step 5.

The token is only shown once. You can’t retrieve it later.

4

Enable the integration

In Aikido, open the Integrations page. Then select Bitbucket under PR Quality Gating.

5

Add the token to Aikido

Paste the Workspace Access Token in Aikido. Aikido will validate the token and its permissions.

6

Configure your first repository

After authorization, Aikido opens the Bitbucket PR Checks page.

Start with one repository first. Confirm everything works before rolling out broadly.

7

Verify with a new PR

Open a new PR in the repo you configured. Then confirm the checks run.

Comments and check updates should appear as the Workspace Access Token identity (for example, AikidoSec).

8

Require the scan as a Merge Check

If you want to block merging until the scan succeeds, configure required checks in Bitbucket.

In Bitbucket, go to Repository settings > Workflow > Branch restrictions. Add or update a restriction for your target branch (for example, main).

Atlassian reference: Suggest or require checks before a merge.

9

Enable for all repositories

Once you’re happy with the results, go back to the Bitbucket PR Checks page and enable checks for the rest of your repositories.

10

Set the default for new repositories

In the top-right, open Actions and select Set Default for New Repos.

See Default PR/MR gating configuration for new repositories for UI guidance.

Last updated

Was this helpful?