mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Configure git to use the certificate, if needed
This commit is contained in:
@@ -129,6 +129,18 @@ func getEnvVars() []string {
|
|||||||
|
|
||||||
if len(git_sources) > 0 {
|
if len(git_sources) > 0 {
|
||||||
goprivate = append(goprivate, git_sources...)
|
goprivate = append(goprivate, git_sources...)
|
||||||
|
|
||||||
|
if proxy_cert_file != "" {
|
||||||
|
slog.Info("Configuring `git` to use proxy certificate", slog.String("path", proxy_cert_file))
|
||||||
|
cmd := exec.Command("git", "config", "--global", "http.sslCAInfo", proxy_cert_file)
|
||||||
|
|
||||||
|
out, cmdErr := cmd.CombinedOutput()
|
||||||
|
slog.Info(string(out))
|
||||||
|
|
||||||
|
if cmdErr != nil {
|
||||||
|
slog.Error("Failed to configure `git` to accept the certificate file", slog.String("error", cmdErr.Error()))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = append(result, fmt.Sprintf("GOPRIVATE=%s", strings.Join(goprivate, ",")))
|
result = append(result, fmt.Sprintf("GOPRIVATE=%s", strings.Join(goprivate, ",")))
|
||||||
|
|||||||
Reference in New Issue
Block a user