> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/docs-as-code/git-sync/github-pull-request-preview.md).

# GitHub のプルリクエストプレビュー

GitHub でプルリクエストを作成する際に、コンテンツのプレビューを確認できます

GitBook のセクションに同期された GitHub ブランチにプルリクエスト（PR）を送信すると、マージ前にコンテンツをプレビューできます。これにより、変更をマージする前にその影響を確認できます。

この機能を使うと、PR をマージする前の最終確認として、同期済みブランチにマージする前に本番環境以外の環境で変更を確認できます。

### プレビューリンクにアクセスする方法

この動作は、 [GitBook GitHub アプリ](https://github.com/apps/gitbook-com) PR に必要な読み取り専用権限。

GitBook セクションと同期されたターゲットブランチを使って作成された各 PR には、固有のプレビュー URL を含むステータスが PR に追加されます。クリックすると、 **詳細** ステータス上のリンクからコンテンツのプレビュー URL に移動します。その後、PR をマージする前にコンテンツが期待どおりか確認できます。

{% hint style="info" %}
プレビューリンクにアクセスできるのは、GitBook アカウントを持つユーザーのみです。
{% endhint %}

### セキュリティ上の考慮事項

セキュリティ上の理由から、既定では GitBook は現在、リポジトリのフォークから開かれた PR のプレビューを生成しません。PR プレビューのコンテンツは、あなたの独自ドメイン配下でアクセス可能であり、 `.gitbook.io` またはカスタムドメインであっても、ユーザーが公開リポジトリのフォークで悪意のあるコンテンツを生成し、それをあなたの名前で配信させる可能性があります。

ユーザーは Git Sync の設定にあるオプションでこれを明示的に設定できます。

### よくある質問

#### なぜ自分のプルリクエストで GitBook ドキュメントのプレビューを確認できないのですか？

一般的な原因:

* **サイトが公開されていません。** PR プレビュー URL は、公開済みのドキュメントサイト（ `.gitbook.io` またはカスタムドメイン）から提供されます。
* **サイトは認証で保護されています。** Git Sync の PR プレビューは、次の背後で公開されているサイトでは利用できません [認証済みアクセス](/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access.md).


---

# 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://gitbook.com/docs/documentation/ja-gitbook-documentation/docs-as-code/git-sync/github-pull-request-preview.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.
