storybranch

Continuous integration

GitHub Actions

storybranch in CI is a test: build Storybook, capture snapshots, exit1 when a shot needs attention. Approval stays on a machine where someone can runstorybranch review. There is no hosted review URL.

Copy-paste recipe

Start from the example workflow and PR comment script in the repo (Node.js 22.18+):

What the job does

  1. Check out with fetch-depth: 0 so--only-changed can find the merge base.
  2. Install dependencies, then runnpx playwright install --with-deps chromium(GitHub-hosted runners need system libraries).
  3. npx storybook build, thennpx storybranch test --build --exit-once.Pull requests also pass --only-changed. Pushes to main capture every story.
  4. On failure, uploadreport.json,actual/, anddiff/ as one artifact. Baselines stay in git.
npx storybook build
npx storybranch test --build --only-changed --exit-once

Flags that matter in CI

After a failed run

Download the workflow artifact, unpack it into the Storybook package, and run storybranch review. The example PR comment lists shots that need attention and links to the workflow run.

Monorepos

Each Storybook app keeps its own.storybranch/. Build and test from that package with --cwd (orSTORYBRANCH_ROOT):

npx storybook build --config-dir apps/web/.storybook \
  --output-dir apps/web/storybook-static
npx storybranch test --build --cwd apps/web --exit-once