ci_env 0.4.1

Detect CI information from the environment.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::api::{var, CiEnvironment, CiProvider};

// https://devcenter.heroku.com/articles/heroku-ci#immutable-environment-variables
pub fn create_environment() -> CiEnvironment {
    CiEnvironment {
        base_branch: None,
        base_revision: None,
        branch: var("HEROKU_TEST_RUN_BRANCH"),
        env_prefix: Some("HEROKU_".into()),
        head_revision: None,
        id: var("HEROKU_TEST_RUN_ID"),
        provider: CiProvider::Heroku,
        request_id: None,
        request_url: None,
        revision: var("HEROKU_TEST_RUN_COMMIT_VERSION"),
        url: None,
    }
}