Skip to main content
Continuous integration (CI) runs automated checks every time your code changes. Adding the Iris Code gate means each change is checked against your project’s thresholds alongside your other tests, and a change that falls short fails the build. The gate runs on your own CI machine, called a runner, so your source code stays there. Install the CLI, store your Pro licence as a CI secret and run iris gate. The command returns a number, called an exit code, that tells the pipeline whether to continue.

Exit codes

Your pipeline decides whether to carry on from the exit code. iris gate uses the same codes as every other Iris Code command: Exit 3 means the gate did not run, which is not the same as it finding nothing. It is returned when you have a licence but it could not be checked, for example because the licence server could not be reached or it is limiting repeated requests. A gate that quietly skipped and reported success would let through a build that should have been stopped. So when the licence cannot be checked, the build fails instead. Having no Pro licence is a different case. That is known, so those commands skip and exit 0, and the pipeline stays green.

Setting IRIS_LICENCE_TOKEN

Add your licence key as a secret in your CI provider’s settings, then pass it as the IRIS_LICENCE_TOKEN environment variable in the step that runs Iris Code. The CLI checks this variable before reading the credentials file, so runners need no iris auth login step. See Authentication for how the CLI signs in.
iris secrets and iris security need no sign-in at all. Use them for a Free CI scan that needs no licence: they work on any runner, whether or not IRIS_LICENCE_TOKEN is set.

GitHub Actions

The example below shows a minimal iris gate step. For the full workflow including branch protection rules and threshold configuration, see the GitHub Actions guide.
For inline PR annotations, use iris gate . --format github (added in v1.6.0). See the full guide at /enforcement/github-actions.
To add the Free secrets and security scans, which need no licence, include these steps separately:

Gating on dependency CVEs

A CVE is a published security advisory for a package. Use iris cve (Pro) as a separate gate for your dependencies. It runs the same scan as iris deps but exits 1 only when it finds an advisory at or above the severity you choose, so minor advisories never fail the pipeline:
See the command reference for severity levels and exit codes.

Telling the team in Slack

A result written only to the build log is seen only by whoever opens that log. Set IRIS_SLACK_WEBHOOK as a protected CI secret and the outcome is posted to a Slack channel as well:
Your own runner builds and sends the message, and it never passes through Iris Code servers, so it can name the failing files. Nothing is posted for a passing run unless you add --slack-on always, and a Slack outage never changes the exit code. See Slack notifications for the full setup.

GitLab CI

Generic shell

For any CI environment that runs arbitrary shell scripts:
iris gate has no threshold flag. Set minHealthScore, and any gateMax* limits, in .irisconfig.json instead. See .irisconfig.json for the full reference.
Pair iris gate (Pro) with iris secrets (Free) so each covers what the other does not. The gate stops code that misses your thresholds, and the secrets scan catches leaked credentials on every push, whatever your licence status.

Check the pre-push hook record

A pre-push hook is a check that runs on a developer’s machine before git push. For a repository connected to a Team with teamProjectId, you can check in CI that each pushed commit went through that hook. Add a separate step after the gate:
The gate keeps its own exit code. Hook verification always exits 0: a missing record shows up as a warning and in the Team audit log, never as a failed build. It checks the latest commit on the pull request (the PR head SHA) rather than GitHub’s temporary merge commit. See Team governance for skip conditions and evidence limits.