mirror of
https://github.com/julia-actions/julia-buildpkg.git
synced 2026-02-12 09:26:54 +08:00
Add Julia registries only when not present
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user