React PlumberInstall package

Guides

CI and pull requests

In CI, Plumber checks each pull request against the branch it merges into. Drift that's new in the changed files fails the check; drift you already had, recorded in the ledger, doesn't. Additions to the ledger need approval from someone you name.

Set it up

sh
npx plumber install --ci

That writes .github/workflows/plumb.yml, if you don't have that file yet. When it detects no agent, it also writes AGENTS.md. In an npm project the workflow looks like this:

yaml
name: React Plumber
on:
  pull_request:
  pull_request_review:
    types: [submitted, dismissed]
permissions:
  contents: read
  pull-requests: write
jobs:
  plumb:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - uses: actions/setup-node@v4
        with:
          node-version: '22.18.0'
      - run: npm ci
      - uses: unlocalhosted/plumb@v0.6.0
        with:
          base: ${{ github.event.pull_request.base.sha }}
          working-directory: "."
          ledger-approvers: ""

The installer uses the release tag of the version you have. Replace the tag with a commit SHA if you want it pinned. The install step matches your package manager and is there because Plumber compiles with your own Tailwind.

Inputs

InputDefaultWhat it does
basethe pull request's base commitwhat to compare with
working-directory.the folder with your Plumber config
ledger-approversnoneGitHub logins, separated by commas or spaces, who can approve ledger changes
tokengithub.tokenused to comment on the pull request

What fails

The action runs plumber check --base <base>:

You can run the same check locally before you push:

sh
npx plumber check --base main

Ledger changes need approval

Adding to the ledger lets drift in, so it needs a review. If a pull request adds an exception, accepts a changed decision or raises debt, one of your ledger-approvers must approve the pull request; if the author is an approver, that's enough. A later "changes requested" or a dismissed review cancels the approval.

Growing debt is an error even with approval, and approval doesn't clear any other error.

What the pull request shows

text
## Plumber
1 new, 2 fixed, 7 debt, 0 exceptions.
## Coverage
spacing: 1/3 (33.3%); +33.3 pp vs base.
color: 2/2 (100%); +0 pp vs base.
## Ledger
0 growth lines.

The check passes when there are no new errors and any ledger additions are approved. On pull requests from forks, GitHub's default token is read-only, so the comment can't be posted.