The workflow
Add this file at.github/workflows/iris.yml:
iris gate . --format github. Because the file names @v1, fixes to how the action runs the CLI reach you without editing anything.
Inputs
The action also sets an
exit-code output, using the codes in the exit codes table below.
There is deliberately no general threshold input. Your limits live in .irisconfig.json, which is committed and can be reviewed like any other change. A workflow setting that quietly overrode them would defeat the point of having them written down.
For the same reason, command: gate refuses min-score rather than accepting it and checking something you did not ask for. min-score only applies to command: check, where the CLI supports --min-score.
Running the CLI directly
The action is a convenience around the CLI. If you would rather see the exact commands, or choose your own CLI version, run it yourself:Requiring a passing check before merge
A failed workflow reports a problem, but on its own it does not stop anyone merging. To make GitHub refuse the merge, add the Iris Code job as a required status check in a branch protection rule or ruleset for your main branch. Run the workflow once first, so GitHub has the check to list. See GitHub’s required status checks guide. Use the job name shown in your workflow, such asiris in the example above.
Configuring the threshold
A.irisconfig.json at your project root:
Annotations on the diff
--format github makes each finding appear on the pull request itself, marked in red on the exact line, so reviewers do not have to search the run’s log. It also writes a pass/fail table into the run’s job summary.
It works with iris check as well as iris gate.
Saving a machine-readable report
To keep a JSON report that other tools can read, whether the gate passed or failed, add two steps after the gate:if: always() makes the steps run even after the gate fails, which is when the report is most useful.
Slack notifications
Add anIRIS_SLACK_WEBHOOK secret and a failed gate is also posted to a Slack channel. See Slack notifications.
Exit codes
Exit code
3 is not a gate failure. It means Iris Code could not confirm your licence, because the licence server was unreachable or was turning away too many repeated requests. Rather than report a pass it never checked, the gate stops there. Retry the job; your code is not the problem.
A repository with no Pro licence at all is a different case and still exits 0.
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. Findings marked on the changed lines are GitHub-only; elsewhere the exit code decides whether the job passes.