> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/pr-torirsugtingu/bitbucket-pr-gating/bitbucket-ci-pr-gating-via-aikido-dashboard-with-a-workspace-access-token.md).

# Bitbucket Premium: PRゲーティングのセットアップ

Bitbucketのプルリクエストスキャンを設定して、Aikidoの問題についてスキャン結果とコメントを公開します。パイプラインコードは不要です。

{% hint style="warning" %}
この設定は **Bitbucket Premium**.

次の場合に使用します: ～を介して認証したいとき **Workspace Access Token**。また、マージ前の必須チェック（PRゲーティング）もサポートします。

もしご利用中のプランが **Bitbucket Free または Standard**の場合は、 [**ユーザーベースの設定**](/docs/docs-ja/pr-torirsugtingu/bitbucket-pr-gating/bitbucket-ci-pr-gating-via-aikido-dashboard.md) の代わりに。
{% endhint %}

## Bitbucket PR Scanning を設定する <a href="#setting-up-bitbucket-ci" id="setting-up-bitbucket-ci"></a>

{% stepper %}
{% step %}
**Workspace Access Token を作成する**

Bitbucket で、次へ移動します: `ワークスペース設定 > アクセストークン`.

選択します **アクセス トークンを作成**.

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-9e3c0f0582cc4b8750f089b7253c2561804e3e26%2FScreenshot%202026-02-27%20at%2011.50.37.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**適切なアクセス権を付与する**

トークンに名前を付けます（例: `AikidoSec`）。ローテーション ポリシーに合った有効期限を設定します。

次のスコープを有効にします:

* **リポジトリ:** 読み取りと書き込み
* **プルリクエスト:** 読み取りと書き込み
* **Webhook:** 読み取りと書き込み
* **Pipelines:** 読み取りと書き込み

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-bff3fd48b0f998b51133f9bf345639150c3b7fe6%2FScreenshot%202026-02-27%20at%2012.25.21.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**アクセストークンをコピーする**

生成されたトークンをコピーし、手順5に貼り付けます。

トークンは一度しか表示されません。後から取得することはできません。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-0de419ea6322b8f54782292fb82c622bf93bba1d%2FScreenshot%202026-02-27%20at%2012.06.22.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**連携を有効にする**

Aikido で、次を開きます: [連携](https://app.aikido.dev/settings/integrations?section=ci) ページ。次に、 **Bitbucket** 以下の **PR Quality Gating**.

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-40075f81a6a797407276d4cf64fd9e8d4a5eb9a9%2FScreenshot%202026-02-26%20at%2016.57.41.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Aikido にトークンを追加する**

Workspace Access Token を Aikido に貼り付けます。Aikido がトークンとその権限を検証します。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-3867f5232e14ac12e26d9bd978fa7da633a02588%2FScreenshot%202026-02-27%20at%2012.07.45.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**最初のリポジトリを設定する**

認証後、Aikido は次を開きます: [Bitbucket PR Checks](https://app.aikido.dev/settings/integrations/bitbucket/checks) ページ上で使用します。

まずは **1つのリポジトリ** を最初に設定します。全体に展開する前に、すべてが正しく動作することを確認してください。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-ff730017744cac5b9148a817045c11610fd86445%2FScreenshot%202026-02-26%20at%2017.02.36.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**新しいPRで確認する**

設定したリポジトリで新しいPRを開きます。次に、チェックが実行されることを確認します。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-568bd026adfc6c847c8d7e1a0811434658ef04bd%2FScreenshot%202026-02-26%20at%2018.04.55.png?alt=media" alt=""><figcaption></figcaption></figure></div>

コメントとチェックの更新は、Workspace Access Token のIDとして表示されるはずです（例: `AikidoSec`).

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-6f526277eecb2d594f46f86871ab328396d00235%2FScreenshot%202026-02-26%20at%2018.09.19.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**マージチェックとしてスキャンを必須にする**

スキャンが成功するまでマージをブロックしたい場合は、 **必須チェック** を Bitbucket で設定します。

Bitbucket で、次へ移動します: `リポジトリ設定 > ワークフロー > ブランチ制限`。対象ブランチの制限を追加または更新します（例: `main`).

Atlassian の参考情報: [マージ前にチェックを提案または必須にする](https://support.atlassian.com/bitbucket-cloud/docs/suggest-or-require-checks-before-a-merge/).
{% endstep %}

{% step %}
**すべてのリポジトリで有効にする**

結果に満足したら、 [Bitbucket PR Checks](https://app.aikido.dev/settings/integrations/bitbucket/checks) ページに戻り、残りのリポジトリでチェックを有効にします。

<div data-with-frame="true"><figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-4d6f5bf3c25c48beba52c724565e081059b0d921%2FScreenshot%202026-02-26%20at%2018.13.59.png?alt=media" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**新しいリポジトリのデフォルトを設定する**

右上で、次を開きます: `アクション` and select `新しいリポジトリのデフォルトを設定`.

参照 [新しいリポジトリに対するデフォルトのPR/MRゲーティング設定](/docs/docs-ja/pr-torirsugtingu/aikido-ci-gating-functionality/default-pr-mr-gating-configuration-for-new-repositories.md) UI の案内はこちら。
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/docs/docs-ja/pr-torirsugtingu/bitbucket-pr-gating/bitbucket-ci-pr-gating-via-aikido-dashboard-with-a-workspace-access-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
