Bitbucket Premium: PR Gating Setup

Publish PR scan results and comments for issues from Aikido. Optionally make them required before merge. No pipeline code needed.

circle-exclamation

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 Integrationsarrow-up-right 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 Checksarrow-up-right 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 mergearrow-up-right.

9

Enable for all repositories

Once you’re happy with the results, go back to the Bitbucket PR Checksarrow-up-right 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?