Skip to content

Commit

Permalink
Merge #463
Browse files Browse the repository at this point in the history
463: Replace a use of `withenv` with `setenv` instead r=DilumAluthge a=DilumAluthge



Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
  • Loading branch information
bors[bot] and DilumAluthge committed Oct 31, 2023
2 parents 417e865 + d0ac11f commit addd1f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
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))

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

2 comments on commit addd1f4

@DilumAluthge
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/94469

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.10.0 -m "<description of version>" addd1f4abfd7b855feec63cd9434f721b3c19d86
git push origin v3.10.0

Please sign in to comment.