From 7e283cc407b7e3a2db65fbb58874c363714013d7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 4 Jun 2024 23:07:27 +1000 Subject: [PATCH] Add `GhApiClient::has_gh_token` Signed-off-by: Jiahao XU --- crates/binstalk-git-repo-api/src/gh_api_client.rs | 4 ++++ 1 file changed, 4 insertions(+) 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 84f75890..073f475a 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -163,6 +163,10 @@ impl GhApiClient { } } + pub fn has_gh_token(&self) -> bool { + self.get_auth_token().is_some() + } + async fn do_fetch( &self, graphql_func: GraphQLFn,