Skip to content

CI integration

Running Aburi in CI does two things: it puts the report where reviewers will see it, and it fails the build on changes that need a human.

GitHub Actions

yaml
name: Aburi
on: pull_request

permissions:
  contents: read
  pull-requests: write

jobs:
  aburi:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: kage1020/Aburi/packages/github-action@main
        with:
          version: latest
          fail-on: "removed,dropped-toggled:to-dropped:>10"

The action diffs the pull request's base against its head and posts the report as a comment. That comment carries a hidden marker, so every push rewrites it in place instead of piling up a new one.

InputEffect
versionWhich @aburi/cli version to run (latest, 0.1.0, and so on). Applies to cli: dlx.
fail-onPassed to aburi diff --fail-on. Leave it empty to report without ever failing.
cliHow the binary is resolved: dlx (default) or workspace. See below.

fetch-depth: 0 is required

Aburi checks out the base revision to analyse it, and a shallow clone cannot give it one. Without the full history the run stops early rather than handing you a wrong diff.

Running the CLI your project installed

By default the action fetches the CLI with pnpm dlx, which needs no install step and puts @aburi/cli in the pnpm store rather than in your checkout. The CLI resolves plugin refs from its own location, so a config naming a plugin by packagelanguages: ["lang-typescript"], which is what aburi init writes — fails there with Cannot find package '@aburi/lang-typescript', no matter what your project has installed. A plugin named by relative path (./plugins/x.mjs) resolves against your workspace root and is fine either way.

Set cli: workspace and the action runs the @aburi/cli in your own node_modules instead, plugins beside it — the install Getting started walks through. Install the workspace first; version then has nothing to pin, because your lockfile already pinned it.

yaml
- uses: actions/checkout@v4
  with: { fetch-depth: 0 }
- uses: pnpm/action-setup@v4
  with: { version: 10 }
- uses: actions/setup-node@v4
  with:
    node-version: 24
    cache: pnpm
- run: pnpm install --frozen-lockfile
- uses: kage1020/Aburi/packages/github-action@main
  with:
    cli: workspace
    fail-on: "removed"

The CLI is located with Node's own resolver rather than a node_modules/.bin entry, so npm, yarn and bun projects work the same way, as does a workspace that builds the CLI from source. Yarn PnP is the exception — it has no node_modules, and .pnp.cjs loads through yarn node — so cli: workspace exits 2 there.

Aburi analyses its own pull requests this way, with the CLI each pull request builds: .github/workflows/aburi.yml.

Any other CI

The CLI has no opinion about your platform. Run it and read the exit code.

CodeMeaningWhat to do
0Clean.Nothing.
3A gate tripped, or the scan was too damaged to trust.Fail the build.
2Your invocation is wrong: bad flag, malformed --fail-on.Fix the pipeline.
bash
aburi diff "origin/${BASE_BRANCH}..HEAD" --fail-on 'removed,changed:>20'

out/diff.md is the report. Post it wherever your platform takes Markdown.

Set the CI environment variable and aburi scan drops the timestamp from its output, so identical commits produce identical bytes.

Choosing a gate

Start narrow. A gate that fires on every pull request gets ignored within a week.

GateFires when
removedSomebody deleted a symbol. Cheap, and rarely noisy.
api-changedA public signature or decorator changed.
changed:>20The semantic change set is unusually large.
dropped-toggled:to-dropped:>10Somebody emptied many method bodies at once, the signature of a half-finished refactor.

Combine them with commas. The first clause that fires ends the evaluation.

bash
aburi diff main..HEAD --fail-on 'removed,changed:>20'

The CLI reference has the full grammar.

Released under the Apache License 2.0.