mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(publish): disable provenance if not in GHA (#22638)
The condition was wrong
This commit is contained in:
parent
e4ef6a4b8e
commit
ea3651a1ac
2 changed files with 6 additions and 5 deletions
|
@ -472,7 +472,7 @@ async fn perform_publish(
|
|||
mut publish_order_graph: PublishOrderGraph,
|
||||
mut prepared_package_by_name: HashMap<String, Rc<PreparedPublishPackage>>,
|
||||
auth_method: AuthMethod,
|
||||
no_provenance: bool,
|
||||
provenance: bool,
|
||||
) -> Result<(), AnyError> {
|
||||
let client = http_client.client()?;
|
||||
let registry_api_url = jsr_api_url().to_string();
|
||||
|
@ -533,7 +533,7 @@ async fn perform_publish(
|
|||
®istry_api_url,
|
||||
®istry_url,
|
||||
&authorization,
|
||||
no_provenance,
|
||||
provenance,
|
||||
)
|
||||
.await
|
||||
.with_context(|| format!("Failed to publish {}", display_name))?;
|
||||
|
@ -560,7 +560,7 @@ async fn publish_package(
|
|||
registry_api_url: &str,
|
||||
registry_url: &str,
|
||||
authorization: &str,
|
||||
no_provenance: bool,
|
||||
provenance: bool,
|
||||
) -> Result<(), AnyError> {
|
||||
let client = http_client.client()?;
|
||||
println!(
|
||||
|
@ -668,7 +668,7 @@ async fn publish_package(
|
|||
);
|
||||
|
||||
let enable_provenance = std::env::var("DISABLE_JSR_PROVENANCE").is_err()
|
||||
|| (auth::is_gha() && auth::gha_oidc_token().is_some() && !no_provenance);
|
||||
&& (auth::is_gha() && auth::gha_oidc_token().is_some() && provenance);
|
||||
|
||||
// Enable provenance by default on Github actions with OIDC token
|
||||
if enable_provenance {
|
||||
|
@ -948,7 +948,7 @@ pub async fn publish(
|
|||
prepared_data.publish_order_graph,
|
||||
prepared_data.package_by_name,
|
||||
auth_method,
|
||||
publish_flags.no_provenance,
|
||||
!publish_flags.no_provenance,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
|
|
@ -444,6 +444,7 @@ mod tests {
|
|||
}
|
||||
|
||||
/// Test that flushing a large number of times doesn't hang.
|
||||
#[ignore]
|
||||
#[tokio::test]
|
||||
async fn test_flush_lots() {
|
||||
test_util::timeout!(60);
|
||||
|
|
Loading…
Reference in a new issue