diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-03-06 18:26:20 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-06 18:26:20 +0530 |
commit | 156950828e8c25f9de346c7cd737f1d0ebc8c1fb (patch) | |
tree | 19d13eb33aa4df107238dbc6780c70cebc2f6270 /cli/tools/registry/auth.rs | |
parent | 89d7bc693a281db06ac1b70ea3e81735d28069fc (diff) |
fix(publish): permissionless dry-run in GHA (#22679)
Fixes https://github.com/denoland/deno/issues/22658
Diffstat (limited to 'cli/tools/registry/auth.rs')
-rw-r--r-- | cli/tools/registry/auth.rs | 6 |
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)); } |