Skip to content

eval-action — Getting started

eval-action is a thin GitHub Action that wraps the Plune CLI (@plune-ai/cli). On every pull request it runs your Plune evals, compares the result against the base branch, and leaves a single, updated comment with the diff — which evals regressed, which improved — and can fail the check when a regression appears. It is the Gate step in Plune’s Generate → Evaluate → Gate flow.

v1.10.11MIT

On each pull request the Action:

  1. Runs plune run on the PR head (the current checkout).
  2. Runs plune run on the base ref in a detached git worktree, so your checkout is untouched.
  3. Runs plune diff between the two — markdown for the comment, JSON for the outputs and the gate.
  4. Posts (or updates) one sticky PR comment with the diff, and optionally fails the check on a regression.

Add .github/workflows/plune-eval.yml to your repository:

name: Plune eval diff
on:
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: write # so the Action can post/update the sticky diff comment
jobs:
plune:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history, so the Action can diff the PR against the base branch
- uses: plune-ai/eval-action@v1
with:
config: plune.yaml
base-ref: main
# use-mock: 'true' # default — zero-cost, deterministic, no API key
# fail-on-regression: 'true' # uncomment to block merges on a pass→fail regression or an eval that could not be measured

With the safe defaults it runs on the mock provider — no API key, zero cost, fully deterministic — and only comments (never blocks merges). You need a plune.yaml in your repository; see the Plune CLI to create one.

The diff classifies every eval by its transition between the base branch and the PR. Only a genuine passed → failed transition is a regression — an eval already failing on the base branch does not turn the check red.

TransitionMeaningGates?
passed → failedregressionyes (when fail-on-regression: true)
failed → passedimprovementno
failed → failedpre-existing failureno
absent → failednew failureno
any → errorednot measured: the PR’s run errored (for example the provider did not answer)yes, as its own error (when fail-on-regression: true)
errored → failednot measured: nothing on the base branch to compare againstyes, as its own error (when fail-on-regression: true)
errored → passedimprovementno

An eval that was not measured is not a regression, but it was not checked either, so “no regressions” would be a guess. With fail-on-regression: true the check fails with its own message (Plune could not measure N eval(s)…). A provider that did not answer is cleared by re-running the job; an eval that errors every time (for example an llm-judge assertion on the mock provider, which has no judge to ask) keeps the check red until the eval is fixed — the run summary names its error. has-regression stays false in that case, and the unmeasured output carries the count. From eval-action v1.8.8 with @plune-ai/cli 0.34.1 or later; an older plune-version reports 0 and the action behaves as before.

InputDefaultDescription
configplune.yamlPath to your Plune config (relative to working-directory).
working-directory.Directory to run Plune in.
base-refmainBaseline git ref to compare against.
use-mocktrueRun on the built-in mock provider (no key, zero cost). Set false to use a real provider.
fail-on-regressionfalseFail the check (block merge) when a regression is detected, or when an eval could not be measured.
max-pass-rate-drop-percentempty (off)Gate: fail the check when the overall pass rate drops by more than this many percentage points.
max-cost-usdempty (off)Gate: fail the check when the PR run costs more than this many USD.
max-cost-increase-percentempty (off)Gate: fail the check when the PR run costs more than this many percent over the baseline.
max-tokensempty (off)Gate: fail the check when the PR run uses more than this many tokens (input plus output).
waiversempty (off)Path to a waivers YAML file for measured gate failures (relative to working-directory).
commenttruePost and update a sticky PR comment with the diff.
plune-version0.39.13Version of @plune-ai/cli to install from npm.

The gate inputs and waivers need a plune-version with the plune diff gates (@plune-ai/cli 0.38.0 or newer). The action passes each one to plune diff as the flag of the same name; what each gate measures, and why a cost gate on the mock provider reads «not measured», is in the gates in GitHub Actions.

OutputDescription
has-regressiontrue when at least one regression was detected.
regressionsNumber of regressions.
unmeasuredNumber of evals that could not be measured (their run errored); 0 when everything was measured.
summaryOne-line diff summary.
gate-exit-codeExit code of plune diff with fail-on-regression or a gate input set: 0 passed, 1 a measured failure, 2 an input error, 3 not measured. Empty when none is set, or when the base ref has no baseline yet.

By default the Action uses the mock provider, so PRs cost nothing and stay deterministic. To evaluate against a real model, set use-mock: 'false' and provide the provider key from a repository secret — never hard-code keys:

- uses: plune-ai/eval-action@v1
with:
use-mock: 'false'
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

Keys are read only from the environment and are never printed to logs or included in the PR comment.

On PRs from forks, GitHub provides a read-only token, so the Action cannot post a comment. It still runs the evals and computes the diff; the comment step is skipped with a notice rather than failing. The Action never uses pull_request_target (which would expose secrets to untrusted PR code).

  • The Action tracks a moving v1 tag — pin to it: plune-ai/eval-action@v1.
  • The Action’s version is independent of the CLI’s. Internally it pins a specific published @plune-ai/cli version via the plune-version input. The current default lives in action.yml — check there rather than trusting a number copied into prose.
  • That pin always references a version already on npm.

MIT © Plune Contributors.