From bf844027bc25fddfeabcb617ce109227875c7e39 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 5 Nov 2024 21:22:38 -0500 Subject: [PATCH] Turn off the GitHub actions cache if the user expresses no preference, and flakehub cache is in use --- magic-nix-cache/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/magic-nix-cache/src/main.rs b/magic-nix-cache/src/main.rs index 0b62a72..97ae9c9 100644 --- a/magic-nix-cache/src/main.rs +++ b/magic-nix-cache/src/main.rs @@ -367,7 +367,10 @@ async fn main_cli() -> Result<()> { None }; - let gha_cache = if args.github_cache_preference() != CacheTrinary::Disabled { + let gha_cache = if (args.github_cache_preference() == CacheTrinary::Enabled) + || (args.github_cache_preference() == CacheTrinary::NoPreference + && flakehub_state.is_none()) + { tracing::info!("Loading credentials from environment"); let credentials = Credentials::load_from_env()