Skip to content

Gantry in CI

The GitHub Action downloads one Gantry release, checks its SHA-256 against the release’s checksums.txt, and runs it. The recommended pull-request job:

- uses: actions/checkout@v7
with: { fetch-depth: 0 } # --base needs history; LFS is not needed for lint
- uses: c65llc/gantry@v0
with: { version: v0.9.2, args: "lint --format github --base origin/${{ github.base_ref }}" }
  • --format github turns the findings into annotations on the pull request, and the Action appends the output, with its tally, to the job’s step summary.
  • --base turns on the history rules, which compare the branch with the point it forked from: a ruling edited without an amendment, a defect ID removed or taken twice, a baseline that grew. Without --base they are listed as skipped. A base that cannot be read fails with base-unavailable, which usually means a shallow checkout.
  • version pins the release. The Action’s @v0 tag moves with each 0.x release, but the binary changes only when you change version.

Lint checks the generated pages too (generated-stale), so a pull request that changes a record without running gantry generate fails.

If gantry.yaml configures gates, run them in a job of their own:

- uses: c65llc/gantry@v0
with:
version: v0.9.2
args: sweep --format github

sweep fails when a gate finds something, scans nothing, or cannot prove itself with a selftest; and with no gates configured it fails too. See lint rungs and gates.

A project that adopts Gantry with existing findings can record them once:

Terminal window
gantry lint --update-baseline

That writes .gantry/lint.baseline.json. CI then fails only on new findings, and the baseline may only shrink (baseline-grew). History findings, generated-stale and files that do not parse are never baselined.

gantry skills hooks pre-commit prints a git pre-commit hook that refuses a commit whose records are not formatted (gantry fmt --check) or not lint-clean; it edits nothing, and says where to save it. See working with coding agents for the agent hooks.