Skip to content

Use Courier in CI

courier run exits with 1 when a request or test fails, so a CI job fails with it. Point it at a folder of checks and an environment.

Terminal window
courier run api-checks --env staging --var token="$API_TOKEN" --reporter junit -o courier.xml
Reporter Use it for
--reporter junit -o report.xml Test dashboards in GitHub Actions, GitLab, Jenkins and others
--reporter json -o report.json Your own scripts
--reporter html -o report.html A page to read: a summary, every request with its status, time and tests, and failures opened with their response body

Secrets are masked in all three. See courier run.

  • Pass secrets with --var name=value from your CI’s secret store. Names that look secret, such as token or password, are masked in reports.
  • Or use secret references that the runner can resolve, such as secret://vault/… with VAULT_ADDR and VAULT_TOKEN set.

Add a step that fails when your requests and your OpenAPI spec drift apart:

Terminal window
courier sync openapi.yaml api-checks --env staging

See OpenAPI sync.