> 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/getting-started/git-sync/github-pull-request-preview.md).

# 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/saitohenoakusesu/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/getting-started/git-sync/github-pull-request-preview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
