Skip to content

Commit bf81c75

Browse files
authored
fix check on CI private key
1 parent b98ca06 commit bf81c75

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/runtests.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,12 @@ end
9090
@testset "OpenSSH integration" begin
9191
is_ci = parse(Bool, strip(get(ENV, "CI", "false")))
9292
is_gha = parse(Bool, strip(get(ENV, "GITHUB_ACTIONS", "false")))
93-
has_privkey = "CI_READONLY_DEPLOYKEY_FOR_CI_TESTSUITE_PRIVATEKEY" keys(ENV)
94-
if is_ci && is_gha && has_privkey
93+
ssh_privkey = get(ENV, "CI_READONLY_DEPLOYKEY_FOR_CI_TESTSUITE_PRIVATEKEY", nothing)
94+
if is_ci && is_gha && !isnothing(ssh_privkey)
9595
@info "This is GitHub Actions CI, so running the OpenSSH test..."
9696
mktempdir() do sshprivkeydir
9797
privkey_filepath = joinpath(sshprivkeydir, "my_private_key")
9898
open(privkey_filepath, "w") do io
99-
ssh_privkey = ENV["CI_READONLY_DEPLOYKEY_FOR_CI_TESTSUITE_PRIVATEKEY"]
10099
println(io, ssh_privkey)
101100
end # open
102101
# We need to chmod our private key to 600, or SSH will ignore it.

0 commit comments

Comments
 (0)