diff options
Diffstat (limited to 'cli/tools/registry/auth.rs')
-rw-r--r-- | cli/tools/registry/auth.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/tools/registry/auth.rs b/cli/tools/registry/auth.rs index 52936bc98..3d40fa766 100644 --- a/cli/tools/registry/auth.rs +++ b/cli/tools/registry/auth.rs @@ -17,6 +17,14 @@ pub struct OidcConfig { pub token: String, } +pub(crate) fn is_gha() -> bool { + std::env::var("GITHUB_ACTIONS").unwrap_or_default() == "true" +} + +pub(crate) fn gha_oidc_token() -> Option<String> { + std::env::var("ACTIONS_ID_TOKEN_REQUEST_TOKEN").ok() +} + fn get_gh_oidc_env_vars() -> Option<Result<(String, String), AnyError>> { if std::env::var("GITHUB_ACTIONS").unwrap_or_default() == "true" { let url = std::env::var("ACTIONS_ID_TOKEN_REQUEST_URL"); |