summaryrefslogtreecommitdiffstats
path: root/tests/common/mod.rs
blob: 07d772fd82fad50121b465b059835bc47de0429f (plain)
1
2
3
4
5
6
7
use forgejo_api::Forgejo;

pub fn get_api() -> Forgejo {
    let url = url::Url::parse(&std::env::var("FORGEJO_API_CI_INSTANCE_URL").unwrap()).unwrap();
    let token = std::env::var("FORGEJO_API_CI_TOKEN").unwrap();
    Forgejo::new(forgejo_api::Auth::Token(&token), url).unwrap()
}