Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
authors = ["Dilum Aluthge", "Brown Center for Biomedical Informatics", "contributors"]
version = "3.9.0"
version = "3.10.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
10 changes: 5 additions & 5 deletions src/utilities/git.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ function git_push(
ssh = enable_ssh_verbose_b ? "ssh -vvvv" : "ssh"
git_ssh_command = isnothing(pkey_filename) ? ssh : "$(ssh) -i $pkey_filename"

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use addenv? For instance, something like

Suggested change
env2 = copy(ENV);
env2["GIT_SSH_COMMAND"] = git_ssh_command
cmd = `git -c user.name="$name" -c user.email="$email" -c committer.name="$name" -c committer.email="$email" push $force_flag $remote $branch`
@debug "Attempting to run Git push command" cmd env2["GIT_SSH_COMMAND"]
run(setenv(cmd, env2))
cmd = `git -c user.name="$name" -c user.email="$email" -c committer.name="$name" -c committer.email="$email" push $force_flag $remote $branch`
@debug "Attempting to run Git push command" cmd git_ssh_command
run(addenv(cmd, "GIT_SSH_COMMAND" => git_ssh_command))


return nothing
end
Expand Down
3 changes: 3 additions & 0 deletions src/utilities/new_versions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,19 @@ function force_ci_trigger(
# https://github.com/JuliaRegistries/CompatHelper.jl/issues/387
if !isnothing(pkey_filename)
# Do a soft reset to the previous commit
@debug "force_ci_trigger: doing a soft reset to the previous commit"
git_reset("HEAD~1"; soft=true)

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

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

# Force push the changes to trigger the PR
api_retry() do
@debug "force_ci_trigger: force-pushing the changes to trigger CI on the PR"
@mock git_push("origin", branch_name, pkey_filename; force=true, env=env)
end
end
Expand Down