Skip to content
Thally
Log inGet started
Guide

Published · 8 min read

Start from the merged change, map it to every page that describes it, and send only the wrong pages through review.

By Published Updated

Calm editorial illustration of a developer reviewing a stack of documentation pages beside a glowing code branch merge diagram.

A pull request merged an hour ago. Which pages are wrong now? If you can't answer without opening tickets and reading the diff line by line, you have a detection problem, not a writing problem. Working out which docs need updating after merge is a repeatable process: start from the change, map it to every surface that describes it, cut the list down to pages that are actually wrong, and send the fix through review. Here is how to run it.

Start from the merged pull request

Why the merge, and not the ticket or the release? Because the merged PR is the one place where the change is final and fully described. The diff is fixed, and the description, linked issue, and review comments explain the intent.

It is also the moment drift begins. Researchers studying outdated documentation in GitHub repositories suggest that docs fall out of sync so easily because developers are unaware of when their source code modifications render the documentation obsolete. A related paper notes that developers often have to manually check whether the documentation needs to be updated whenever changes are made to the source code. Manual checks get skipped on busy days, and the miss stays invisible until a user hits it.

So pull the facts out of the PR itself. For each merge, capture:

  • Changed public surfaces: API specs, SDK exports, CLI commands, and config schemas
  • Renamed or removed identifiers: endpoints, parameters, flags, environment variables, function names
  • Changed behavior that never shows up in a name: defaults, limits, error messages, permissions, UI labels
  • The stated intent from the PR description and linked issue

Not every merge deserves this treatment. A refactor with no user-facing effect should not start a docs job. If you run on GitHub Actions, you can configure a workflow to run based on which file paths changed, and the workflow runs if at least one path matches a pattern in the paths filter. Point that filter at your public surfaces. One catch: you cannot use both the paths and paths-ignore filters for the same event in a workflow, so pick one approach.

Map the change to docs, site, and help-center pages

You know what changed. Where is it described? Almost never in one place.

The easy case is the generated reference. If your docs site renders the API reference from an OpenAPI file, the only thing CI has to do is rebuild the docs when the spec changes. That part takes care of itself.

The hard case is everything written by hand: guides, tutorials, support articles, and marketing pages that mention a behavior without being "the docs for" that feature. A regenerated reference does nothing for the quickstart that walks through three endpoints in order. It does nothing for the pricing page that quotes a limit, or the help-center article with a screenshot of the old settings screen.

Postman's 2025 State of the API Report puts the cost plainly: "When API information lives everywhere, it becomes outdated or unreliable". The same report found 55% struggling with inconsistent documentation.

To build the candidate list, search all three surfaces, not just the docs repo:

  • Search for exact identifiers from the diff: the old parameter name, the flag, the endpoint path
  • Search for the behavior in plain language, such as "defaults to," "up to," or "requires admin"
  • Check code samples and snippets that call the changed surface
  • Check screenshots and step-by-step UI instructions if the change touched the interface
  • Check the website and help center separately, since they usually live outside the docs repo and outside anyone's habit

The output is a list of candidate pages. Most of it will be noise, and the next step deals with that.

Illustration of Map the change to docs, site, and help-center pages

Separate wrong pages from merely related pages

A search for "webhook" will return forty pages. How many are wrong? Probably two.

This is where most homegrown approaches fall apart. If every merge produces a long list of "possibly affected" pages, reviewers learn to ignore the list. The research backs up the intuition that the wrong pages are a small share of the total. In a study of top GitHub projects, 3.9% of the code element references detected were currently outdated. Yet more than a quarter of the 1000 most popular projects contained at least one outdated reference. The errors are few and widespread, so precision matters more than volume.

A test for which docs need updating after merge

A page is wrong if a reader who follows it gets a different result than the product now produces. A page is merely related if it mentions the feature and every statement on it is still true.

Run each candidate through these questions:

  • Does the page name something the diff renamed or removed?
  • Does it state a default, limit, or requirement the diff changed?
  • Does a code sample on the page still run against the merged code?
  • Does it describe a sequence of steps the change reordered, added to, or shortened?
  • Does it say something is not possible that now is, or the reverse?

If every answer is no, the page is related and you can drop it. If any answer is yes, record the evidence: the specific line in the diff and the specific sentence on the page that contradicts it. That pairing is what makes the finding reviewable, because a reviewer can confirm it in seconds without re-reading the PR.

A third category is the gap, where a merge adds something no page describes. Nothing is wrong yet, but something is missing. Track gaps separately so they don't get lost among corrections.

Draft the update as a pull request

You have a short list of wrong pages with evidence. What's the fastest way to fix them? Put the fix where the engineering team already works.

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 that is reviewed at the same time. If product code and docs live in separate repositories, a common pattern is to send a repository_dispatch event from the product repository to the docs repository on merge, then have a workflow there turn the event into a docs pull request, drafted by a person or by a docs agent.

A good docs update PR contains:

  • A link to the source PR that caused it
  • The list of affected pages, each with the evidence that it is wrong
  • The proposed edits as a normal diff
  • A note on anything the drafter could not verify, such as screenshots that need retaking
  • Any gaps that need a new page and not just an edit

This is the step Thally Automation handles. When a pull request merges, it analyzes the change, drafts the documentation updates it implies, and opens them as a pull request on your docs repo, ready for your review. It works through a read-only GitHub App installed on your product and docs repositories, and you decide what starts a draft.

Whoever drafts the PR, add a quality gate on the docs repository so a broken docs build fails before it ships. Broken links and failed builds are mechanical problems, and CI should catch them so reviewers don't have to.

Illustration of Draft the update as a pull request

Hold publish for human approval

Some teams ask for docs that update automatically after every merge, with no review step at all. That is a bad trade. CI is good at noticing that something changed and running a job. A drafting agent is good at producing a plausible edit. Neither one knows that the change is behind a feature flag until next week, or that the new limit only applies to one plan. An unreviewed wrong edit is worse than a stale page, because it looks fresh.

The goal is a cheap review, not a missing one. If the PR arrives with the wrong pages already identified and the evidence attached, approval takes minutes.

Route it to the right person automatically. On GitHub, code owners are automatically requested for review when someone opens a pull request that modifies code that they own. Two details trip teams up:

  • Code owners are not automatically requested to review draft pull requests, so mark the docs PR ready for review when the draft is complete
  • The CODEOWNERS file must be on the base branch of the pull request for code owners to receive review requests

Give the reviewer a short checklist:

  • Does each edit match the evidence cited?
  • Is the change live for all users, or gated?
  • Is anything on the affected-pages list missing from the diff?
  • Do the code samples run?

Approval matters more now that AI assistants and coding tools read your docs too. A wrong sentence no longer misleads only the person on the page. It gets repeated in answers elsewhere. If you publish the same source as a site, Markdown, JSON, and llms.txt, as Thally does, one approved fix corrects every output at once.

DORA's research has found a clear link between documentation quality and organizational performance, and it is blunt that documentation needs to be actively created and maintained, which takes work. This process doesn't remove the work. It shows you after every merge exactly where the work is, so nobody has to dig for it.

Sources

  1. Detecting Outdated Code Element References in Software Repository Documentation (Tan, Wagner & Treude, Empirical Software Engineering)
  2. Wait, wasn't that code here before? Detecting Outdated Software Documentation
  3. 2025 State of the API Report (Postman)
  4. DORA: Documentation quality
  5. About code owners (GitHub Docs)
  6. Workflow syntax for GitHub Actions (GitHub Docs)
  7. Set Up CI to Trigger Documentation Updates | Thally
  8. Keep Your Docs Site in Sync With Code Changes | Thally
  9. Thally Automation: Ship the Code. Docs Follow. | 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.