Skip to content

ci

Detecting CI environments and reporting pipeline status.

detect, is_ci and is_pull_request take the environment as a lookup function instead of reading it, so they are as easy to test as to use (&|name| std::env::var(name).ok()). Status, overall and render_report turn job results into the Markdown summary of a PR comment.

Cargo feature ci (enabled by default). To compile only this module:

cargo add helpers4 --no-default-features --features ci

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.6", default-features = false, features = ["ci"] }

Import path: helpers4::ci.

ItemWhat it does
detectWhich CI service the environment belongs to, if any.
is_ciWhether the environment looks like a CI run.
is_pull_requestWhether the current CI run was triggered by a pull request (or merge request).
overallThe single status that sums up several: the worst one wins.
ProviderA continuous-integration service, as recognized by detect.
render_reportA Markdown summary of a pipeline, ready for a PR comment or a job summary.
StatusThe outcome of a CI job or step.