summaryrefslogtreecommitdiff
path: root/cli/tools/registry/auth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/registry/auth.rs')
-rw-r--r--cli/tools/registry/auth.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/tools/registry/auth.rs b/cli/tools/registry/auth.rs
index 3d40fa766..820d3b6b6 100644
--- a/cli/tools/registry/auth.rs
+++ b/cli/tools/registry/auth.rs
@@ -43,7 +43,13 @@ fn get_gh_oidc_env_vars() -> Option<Result<(String, String), AnyError>> {
pub fn get_auth_method(
maybe_token: Option<String>,
+ dry_run: bool,
) -> Result<AuthMethod, AnyError> {
+ if dry_run {
+ // We don't authenticate in dry-run mode.
+ return Ok(AuthMethod::Interactive);
+ }
+
if let Some(token) = maybe_token {
return Ok(AuthMethod::Token(token));
}