Skip to content

Commit addd1f4

Browse files
Merge #463
463: Replace a use of `withenv` with `setenv` instead r=DilumAluthge a=DilumAluthge Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
2 parents 417e865 + d0ac11f commit addd1f4

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CompatHelper"
22
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
33
authors = ["Dilum Aluthge", "Brown Center for Biomedical Informatics", "contributors"]
4-
version = "3.9.0"
4+
version = "3.10.0"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/utilities/git.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ function git_push(
3434
ssh = enable_ssh_verbose_b ? "ssh -vvvv" : "ssh"
3535
git_ssh_command = isnothing(pkey_filename) ? ssh : "$(ssh) -i $pkey_filename"
3636

37-
withenv("GIT_SSH_COMMAND" => git_ssh_command) do
38-
cmd = `git -c user.name="$name" -c user.email="$email" -c committer.name="$name" -c committer.email="$email" push $force_flag $remote $branch`
39-
@debug "Attempting to run Git push command" cmd
40-
run(cmd)
41-
end
37+
env2 = copy(ENV);
38+
env2["GIT_SSH_COMMAND"] = git_ssh_command
39+
cmd = `git -c user.name="$name" -c user.email="$email" -c committer.name="$name" -c committer.email="$email" push $force_flag $remote $branch`
40+
@debug "Attempting to run Git push command" cmd env2["GIT_SSH_COMMAND"]
41+
run(setenv(cmd, env2))
4242

4343
return nothing
4444
end

src/utilities/new_versions.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,16 +324,19 @@ function force_ci_trigger(
324324
# https://github.com/JuliaRegistries/CompatHelper.jl/issues/387
325325
if !isnothing(pkey_filename)
326326
# Do a soft reset to the previous commit
327+
@debug "force_ci_trigger: doing a soft reset to the previous commit"
327328
git_reset("HEAD~1"; soft=true)
328329

329330
# Sleep for 1 second to make sure the timestamp changes
330331
sleep(1)
331332

332333
# Commit the changes once again to generate a new SHA
334+
@debug "force_ci_trigger: commiting again, in order to generate a new SHA"
333335
git_commit(pr_title; env=env)
334336

335337
# Force push the changes to trigger the PR
336338
api_retry() do
339+
@debug "force_ci_trigger: force-pushing the changes to trigger CI on the PR"
337340
@mock git_push("origin", branch_name, pkey_filename; force=true, env=env)
338341
end
339342
end

0 commit comments

Comments
 (0)