From 156950828e8c25f9de346c7cd737f1d0ebc8c1fb Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 6 Mar 2024 18:26:20 +0530 Subject: fix(publish): permissionless dry-run in GHA (#22679) Fixes https://github.com/denoland/deno/issues/22658 --- cli/tools/registry/auth.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/tools/registry/auth.rs') 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> { pub fn get_auth_method( maybe_token: Option, + dry_run: bool, ) -> Result { + 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)); } -- cgit v1.2.3