From 4fde628f827b5a7d997915f4e5289a923e9802e2 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Wed, 14 Feb 2024 12:36:14 -0500 Subject: [PATCH] fix: Make sure cosign.pub exists before trying to check key validity --- src/commands/build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/build.rs b/src/commands/build.rs index 69a1608..ef34766 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -727,7 +727,8 @@ fn check_cosign_files() -> Result<()> { ) { (Some(github_event_name), Some(github_ref_name), Some(_)) if github_event_name != "pull_request" - && (github_ref_name == "live" || github_ref_name == "main") => + && (github_ref_name == "live" || github_ref_name == "main") + && Path::new("cosign.pub").exists() => { env::set_var("COSIGN_PASSWORD", ""); env::set_var("COSIGN_YES", "true"); @@ -758,7 +759,7 @@ fn check_cosign_files() -> Result<()> { } } _ => { - debug!("Not building on live branch, skipping cosign file check"); + debug!("Not building on live branch or cosign.pub doesn't exist, skipping cosign file check"); Ok(()) } }