Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable git prompts for ssh remotes, pass through ssh-agent env variables. #1821

Merged
merged 2 commits into from
May 22, 2022
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* ![Enhancement][badge-enhancement] The padding of the various container elements in the HTML style has been reduced, to improve the look of the generated HTML pages. ([#1814][github-1814], [#1818][github-1818])
* ![Bugfix][badge-bugfix] Build failures now only show fatal errors, rather than all errors. ([#1816][github-1816])
* ![Bugfix][badge-bugfix] Disable git terminal prompt when detecting remote HEAD branch for ssh remotes, and allow ssh-agent authentication (by appending rather than overriding ENV). ([#1821][github-1821])

## Version `v0.27.17`

Expand Down Expand Up @@ -1032,6 +1033,7 @@
[github-1814]: https://github.com/JuliaDocs/Documenter.jl/issues/1814
[github-1816]: https://github.com/JuliaDocs/Documenter.jl/pull/1816
[github-1818]: https://github.com/JuliaDocs/Documenter.jl/pull/1818
[github-1821]: https://github.com/JuliaDocs/Documenter.jl/pull/1821
<!-- end of issue link definitions -->

[julia-38079]: https://github.com/JuliaLang/julia/issues/38079
Expand Down
5 changes: 4 additions & 1 deletion src/Documenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,12 @@ function deploydocs(;

# Try to figure out default branch (see #1443 and #1727)
if devbranch === nothing
env = copy(ENV)
env["GIT_TERMINAL_PROMPT"] = "0"
env["GIT_SSH_COMMAND"] = get(env, "GIT_SSH_COMMAND", "ssh -o \"BatchMode yes\"")
str = try
read(pipeline(ignorestatus(
setenv(`git remote show origin`, ["GIT_TERMINAL_PROMPT=0"]; dir=root)
setenv(`git remote show origin`, env; dir=root)
); stderr=devnull), String)
catch
""
Expand Down