GitHub pull request preview
Customers who configured the GitBook GitHub app before 6th January 2021 and want to enable this feature will need to accept an updated permission request to enable read-only access to PRs. You should have received a notification requesting this access.
When you submit a Pull Request (PR) to a GitHub branch that has been synced to a GitBook space, you can preview the content before merging. This allows you to check the impact of changes before merging them.
You can use this feature to have a final layer of checks before merging a PR, allowing you to see your changes in a non-production environment before merging it into your synced branch.
![](https://docs.gitbook.com/~gitbook/image?url=https%3A%2F%2F1050631731-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNkEGS7hzeqa35sMXQZ4X%252Fuploads%252FHlxg4ojBepJUupUJpSPn%252FPull%2520request%2520preview2.png%3Falt%3Dmedia%26token%3Dc33a00f6-6d3c-4ecc-bded-83beee7c0ab6&width=768&dpr=4&quality=100&sign=705a07a1&sv=1)
How to access preview links
This behavior works out of the box, provided you have given the GitBook GitHub app the necessary read-only permissions to PRs.
For every PR done using a target branch synced with a GitBook space, you’ll see a status added to the PR with a unique preview URL. Clicking the Details link on the status will take you to the preview URL for your content. You can then make sure the content is as expected before merging the PR.
Preview links are only accessible by GitBook users.
Security considerations
For security reasons, by default GitBook doesn’t currently generate previews for PRs opened from forks of your repository. Because the content of the PR preview is accessible under your own domain, whether on .gitbook.io
or your custom domain, a user could generate malicious content in a fork of your public repository and have it served under your name.
We allow users to explicitly configure this through an option in the Git Sync settings.
Last updated