diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63132171..9a0acffc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: if: env.CARGO_NEXTEST_ADDITIONAL_ARGS != '' env: GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN }} e2e-tests: if: github.event_name != 'pull_request' diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 5b9405d9..60856f66 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -527,10 +527,12 @@ 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() => { + Some(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();