Skip to content

Go: Don't modify global git config for the registry proxy certificate - #22874

Draft
jketema wants to merge 1 commit into
mainfrom
go/proxy-git-cainfo-env
Draft

jketema wants to merge 1 commit into
mainfrom
go/proxy-git-cainfo-env

Conversation

@jketema

@jketema jketema commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

The Go extractor currently runs git config --global http.sslCAInfo <temp cert> when private git_source registries are configured. This persists beyond the job: on non-ephemeral self-hosted runners, later jobs find git pointing at a temporary certificate that no longer exists.

This PR removes that call and instead passes the certificate via GIT_SSL_CAINFO in the environment applied to go commands (next to SSL_CERT_FILE), so it only affects the git processes spawned by go.

Caveat: git invoked outside ApplyProxyEnvVars no longer gets the certificate; I haven't found such callers.

Adds a unit test that getEnvVars returns both variables. go test ./registries passes.

The extractor ran `git config --global http.sslCAInfo <temp cert>` when
private `git_source` registries were configured. That permanently modified
the user's global git configuration, and on non-ephemeral (e.g. self-hosted)
runners it kept pointing at a temporary certificate file after the job
finished, breaking later git HTTPS operations.

Instead, set `GIT_SSL_CAINFO` alongside `SSL_CERT_FILE` in the environment
that `ApplyProxyEnvVars` applies to `go` commands. This is picked up by the
`git` processes `go` spawns, and is scoped to those subprocesses.

Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot added the Go label Oct 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant