> 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 プルリクエストのプレビュー

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/gong-kai/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 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/docs-as-code/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.
