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 githubturns the findings into annotations on the pull request, and the Action appends the output, with its tally, to the job’s step summary.--baseturns 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--basethey are listed as skipped. A base that cannot be read fails withbase-unavailable, which usually means a shallow checkout.versionpins the release. The Action’s@v0tag moves with each 0.x release, but the binary changes only when you changeversion.
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 githubsweep 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.
Adopting with a backlog
Section titled “Adopting with a backlog”A project that adopts Gantry with existing findings can record them once:
gantry lint --update-baselineThat 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.
Before you push
Section titled “Before you push”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.