Skip to content

Commit 1201aed

Browse files
authored
Fix CI on external PRs (#66)
Only run OpenSSH tests if CI private key available and non-empty
1 parent f588510 commit 1201aed

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/runtests.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,12 @@ end
7474

7575
# https://github.com/JuliaVersionControl/Git.jl/issues/51
7676
@testset "OpenSSH integration" begin
77-
is_ci = parse(Bool, strip(get(ENV, "CI", "false")))
78-
is_gha = parse(Bool, strip(get(ENV, "GITHUB_ACTIONS", "false")))
79-
if is_ci && is_gha
80-
@info "This is GitHub Actions CI, so running the OpenSSH test..."
77+
ssh_privkey = get(ENV, "CI_READONLY_DEPLOYKEY_FOR_CI_TESTSUITE_PRIVATEKEY", "")
78+
if !isempty(ssh_privkey)
79+
@info "CI private key available, so running the OpenSSH test..."
8180
mktempdir() do sshprivkeydir
8281
privkey_filepath = joinpath(sshprivkeydir, "my_private_key")
8382
open(privkey_filepath, "w") do io
84-
ssh_privkey = ENV["CI_READONLY_DEPLOYKEY_FOR_CI_TESTSUITE_PRIVATEKEY"]
8583
println(io, ssh_privkey)
8684
end # open
8785
# We need to chmod our private key to 600, or SSH will ignore it.

0 commit comments

Comments
 (0)