mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 07:06:36 +00:00
CI: Fix gh_api_client.rs test
Ignore empty gh token Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
6c71732144
commit
7546e9fb30
1 changed files with 4 additions and 4 deletions
|
@ -527,10 +527,10 @@ mod test {
|
|||
fn create_client() -> Vec<GhApiClient> {
|
||||
let client = create_remote_client();
|
||||
|
||||
let auth_token = env::var("CI_UNIT_TEST_GITHUB_TOKEN")
|
||||
.ok()
|
||||
.map(Box::<str>::from)
|
||||
.map(zeroize::Zeroizing::new);
|
||||
let auth_token = match env::var("CI_UNIT_TEST_GITHUB_TOKEN") {
|
||||
Ok(auth_token) if !auth_token.is_empty() => zeroize::Zeroizing::new(auth_token.into_boxed_str()),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
let gh_client = GhApiClient::new(client.clone(), auth_token.clone());
|
||||
gh_client.set_only_use_restful_api();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue