Skip to content
Thally
Log inGet started
Guide

Published · 8 min read

Set up a docs preview for pull requests: each docs change renders on a preview URL, carries evidence for why it exists, and waits for human approval.

By Published Updated

An illustration of a pull request beside a rendered documentation preview page awaiting a reviewer's approval checkmark.

Who on your team knows which docs pages went stale after this morning's merge? And if someone fixes them, who checks the fix before it goes live? For most engineering leads, the honest answer is "nobody, reliably." A docs preview for pull requests changes that. Every documentation change arrives as a pull request, renders on a preview URL, carries the evidence for why it exists, and waits for a person to approve it. This guide walks through setting that up so docs keep pace with code and nothing publishes without a human sign-off.

Open the docs change as a pull request

Start with where the change lives. If your docs sit in a separate editor with its own workflow, keeping them current depends on someone remembering to go there. When docs are MDX or Markdown in a repository, the documentation update can ride in the same pull request as the code, or in a linked PR reviewed at the same time. The reviewer then sees the code diff and the docs diff together.

That gives you three things a separate editor can't:

  • One review surface. Docs changes get the same diff, comments, and approval flow as code.
  • A history. Every edit has an author, a timestamp, and a reason attached.
  • The same branch rules you already trust for code.

Writing the docs PR is a different problem. On a fast-shipping team, especially one leaning on AI coding tools, nobody wants to stop after every merge and work out which pages just went wrong. Guides, tutorials, support articles, and marketing pages often mention a behavior without being "the docs for" that feature. Those are the pages that drift.

This is the gap Thally's Automation fills. You install a read-only GitHub App on your product and docs repositories. When a pull request merges into a watched branch, Thally analyzes the change, drafts the documentation updates it implies, and opens them as a pull request on your docs repo, ready for your review. You choose which events start a draft. Turn on the ones that change your public surface and leave the rest off. A relevant merge produces either an evidence-backed docs PR or a clear "no change needed".

Whether a person or a tool writes the change, the rule is the same: docs changes arrive as pull requests, never as direct edits to what's live.

Preview the page updates before publish

A Markdown diff tells you which words changed. It doesn't tell you whether the page still renders, whether a code block broke, or whether a callout now sits in the wrong section. Reviewers need to see the page itself.

Set up a docs preview for pull requests

Most hosting platforms can build each pull request to its own URL. Netlify describes Deploy Previews as deploying pull and merge requests "to a unique URL different from the one your production site uses". In its example, pull request #42 deploys to deploy-preview-42--mysitename.netlify.app. Vercel works in a similar way. The latest push to any pull request gets its own preview URL, and "these URLs will be provided through a comment on each pull request". If the bot comments get noisy, you can turn them off and still get preview deployments.

Whatever builds your previews, check these before you rely on them:

  • Previews rebuild on every push to the PR, not only the first one. Reviewers should always see the latest draft.
  • The preview link shows up where reviewers already look, ideally on the PR itself.
  • Previews stay out of search results. Netlify, for example, adds an X-Robots-Tag: noindex header to Deploy Previews so search engines don't index them. You don't want a half-reviewed page outranking your real docs.
  • The preview builds every output you publish. If you also serve Markdown, JSON, or llms.txt for AI tools, a broken build in those formats matters as much as a broken HTML page.

What reviewers should check in the preview

Give reviewers a short, repeatable checklist so preview review takes minutes:

  • Does the changed section render correctly, including code samples and tables?
  • Do links into and out of the changed page still resolve?
  • Does the example still run against the behavior that just merged?
  • Did the change leave a contradiction on a nearby page that wasn't edited?

Illustration of Preview the page updates before publish

Read the evidence behind each edit

A preview shows what changed. Evidence shows why. Without it, a reviewer has two bad options: approve on trust, or reconstruct the reasoning from tickets and diffs.

Good evidence on a docs PR answers a few direct questions:

  • Which merged pull request triggered this edit, with a link to it?
  • Which lines in that change make the current docs wrong?
  • Which page, and which section of that page, does the edit touch?
  • What did the docs say before, and what do they say now?

When a docs PR carries that context, review gets fast and specific. The reviewer can open the source change, confirm the behavior, check the preview, and approve. When it doesn't, the reviewer either rubber-stamps the PR or bounces it back with "why?" Rubber-stamping is how wrong docs get published. Bouncing it back is how docs PRs pile up unreviewed.

It matters because documentation quality isn't cosmetic. DORA reports "a clear link between documentation quality and organizational performance". It measured documentation quality with eight metrics, including clarity, findability, and reliability. DORA's 2023 report also found that high-quality documentation greatly increases how much technical practices improve organizational performance. Reliable docs need reviewers who can verify each change, and they can only do that when the evidence is in front of them.

Evidence also covers the opposite case. "No change needed" is a useful answer when it comes with reasons. A reviewer who can see that a merge was checked and found harmless doesn't have to wonder whether anyone looked.

Stop publish until a human approves

This is the part engineering leads care about most, and GitHub already gives you the controls.

Require approvals on the docs branch

Protect the branch your docs site publishes from. Admins, or custom roles with the "edit repository rules" permission, can require a set number of approving reviews before a pull request merges into a protected branch. In the branch protection settings, you "select the Required number of approvals before merging dropdown menu". Once that's set, a collaborator who tries to merge a pull request with pending or rejected reviews "will receive an error message".

Tighten that with a few more settings:

  • Require code owner reviews. If code owner reviews are required, any pull request that touches files with a code owner needs that owner's approval before it can merge. Assign your docs lead or product owner as code owners for the docs directory.
  • Require approval of the most recent reviewable push. This setting requires someone other than the last person who pushed to approve the pull request. If a draft gets edited after review, a fresh set of eyes has to sign off.
  • Require status checks. You can require status checks to pass before merging, such as a successful preview build or a link check.

Gate the deploy too, if you want a second lock

Branch protection controls what merges. Environment protection controls what deploys. GitHub says "you can use deployment protection rules to require a manual approval, delay a job, or restrict the environment to certain branches". A few details to know before you lean on it:

  • You can enable at most 6 deployment protection rules on one environment at a time.
  • Only one of the required reviewers has to approve for the job to continue.
  • On GitHub Free, Pro, or Team, required reviewers only work in public repositories.
  • By default, admins can bypass the protection rules. Decide on purpose whether that's acceptable for your docs.

What about "automatic, without a review step every time"?

Some teams ask for a docs platform that updates docs automatically after merges with no manual review at all. That's the wrong goal. Without review, the pages your users and AI assistants read can change with nobody checking them. A better goal is to make review cheap. Let automation do the detection and drafting. Put a preview and evidence on every PR. Keep the human step to a quick, informed approval. You save the hours without giving up control.

Illustration of Stop publish until a human approves

Keep rejected drafts in Git

Not every draft should ship. Sometimes the change is internal-only, sometimes the wording is wrong, and sometimes the feature is about to change again. Rejecting a draft is a normal outcome, and it should leave a record.

When a docs draft is a pull request, rejection is just closing it. That gives you more than deleting it would:

  • The closed PR keeps the proposed diff, the evidence, and the review discussion.
  • A comment explaining why it was closed tells the next person not to redo the same edit.
  • If the decision changes, you can reopen the PR or cherry-pick from its branch instead of starting over.
  • Your published docs stay untouched. Nothing merged, so nothing deployed.

A few habits keep this useful:

  • Always leave a brief reason when closing a docs PR, such as "internal flag, not public" or "superseded by a newer PR."
  • Label rejected docs PRs consistently so you can find them later and see which kinds of changes keep getting turned down.

With a preview, the evidence, an approval step, and a record of what was rejected, a docs change gets the same review as the code that caused it.

Sources

  1. About protected branches (GitHub Docs)
  2. Managing a branch protection rule (GitHub Docs)
  3. Deployments and environments (GitHub Docs)
  4. Deploy Previews (Netlify Docs)
  5. Deploying GitHub Projects with Vercel (Vercel Docs)
  6. Documentation quality (DORA, dora.dev)
  7. Thally Automation: Ship the Code. Docs Follow. | Thally
  8. Automatically Update Docs After a PR Merges | Thally
  9. Keep Your Docs Site in Sync With Code Changes | Thally

Published under the Thally editorial policy. Technical conformance is defined in the agent-readiness methodology.

Build docs that stay close to your product.

Create a managed site, or use the open-source engine to run Thally yourself.