The workflow
Drop this in.github/workflows/iris.yml:
iris gate . --format github. Pinning @v1 means fixes to the invocation reach you without editing anything.
Inputs
The action also sets an
exit-code output, matching the codes in the table further down.
There is deliberately no general threshold input. Gate thresholds live in .irisconfig.json, which is committed and reviewable, so a workflow input that quietly overrode them would defeat the point of having a written policy. command: gate rejects min-score rather than accepting it and enforcing something you did not ask for. min-score applies to command: check, where the CLI supports --min-score.
Running the CLI directly
The action is a wrapper. If you would rather see the exact commands, or pin your own CLI version, call it yourself:Configuring the threshold
A.irisconfig.json at your project root:
Annotations on the diff
--format github is what makes findings appear on the pull request itself, in red, on the exact line. No log-scraping, no extra action. It also writes a pass/fail table into the run’s job summary.
It works on iris check too, not just iris gate.
Saving a machine-readable report
To hang onto a machine-readable report whether the gate passed or failed, add two steps after the gate:if: always() is what makes the report available after a failed gate, which is when it is most useful.
Slack notifications
Add anIRIS_SLACK_WEBHOOK secret and the result posts to Slack as well as failing the build. See Slack notifications.
Exit codes
Not on GitHub? Iris Code: Add CI Pipeline Snippet generates the equivalent for GitLab CI, Bitbucket Pipelines, an npm script, or a plain shell step. Inline annotations are GitHub-only; everywhere else the exit code does the work.