mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 07:44:48 -05:00
fix(publish): permissionless dry-run in GHA (#22679)
Fixes https://github.com/denoland/deno/issues/22658
This commit is contained in:
parent
89d7bc693a
commit
156950828e
2 changed files with 8 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -884,7 +884,8 @@ pub async fn publish(
|
|||
) -> Result<(), AnyError> {
|
||||
let cli_factory = CliFactory::from_flags(flags).await?;
|
||||
|
||||
let auth_method = get_auth_method(publish_flags.token)?;
|
||||
let auth_method =
|
||||
get_auth_method(publish_flags.token, publish_flags.dry_run)?;
|
||||
|
||||
let import_map = cli_factory
|
||||
.maybe_import_map()
|
||||
|
|
Loading…
Reference in a new issue