From ab02b8f55c9f4cc8614bb09a557f462e7357b890 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Tue, 9 Jan 2024 14:58:51 -0600 Subject: [PATCH] Add Julia registries only when not present --- action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 2d2d110..b961a32 100644 --- a/action.yml +++ b/action.yml @@ -46,14 +46,19 @@ runs: if VERSION >= v"1.5-" - Pkg.Registry.add("General") + if !any(r -> r.name == "General", Pkg.Registry.reachable_registries()) + Pkg.Registry.add("General") + end # If provided add local registries if !isempty("${{ inputs.localregistry }}") local_repos = split("${{ inputs.localregistry }}", "\n") .|> string for repo_url in local_repos isempty(repo_url) && continue - Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url)) + # https://github.com/JuliaLang/Pkg.jl/issues/3753 + if !any(r -> r.repo == repo_url, Pkg.Registry.reachable_registries()) + Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url)) + end end end end