@@ -43,6 +43,7 @@ import (
43
43
"github.com/fatih/color"
44
44
"github.com/go-git/go-billy/v5"
45
45
"github.com/go-git/go-billy/v5/osfs"
46
+ "github.com/go-git/go-git/v5/plumbing/transport"
46
47
githttp "github.com/go-git/go-git/v5/plumbing/transport/http"
47
48
v1 "github.com/google/go-containerregistry/pkg/v1"
48
49
"github.com/google/go-containerregistry/pkg/v1/remote"
@@ -196,6 +197,10 @@ type Options struct {
196
197
// This is optional!
197
198
GitPassword string `env:"GIT_PASSWORD"`
198
199
200
+ // GitHTTPProxyURL is the url for the http proxy.
201
+ // This is optional!
202
+ GitHTTPProxyURL string `env:"GIT_HTTP_PROXY_URL"`
203
+
199
204
// WorkspaceFolder is the path to the workspace folder
200
205
// that will be built. This is optional!
201
206
WorkspaceFolder string `env:"WORKSPACE_FOLDER"`
@@ -363,6 +368,11 @@ func Run(ctx context.Context, options Options) error {
363
368
Password : options .GitPassword ,
364
369
}
365
370
}
371
+ if options .GitHTTPProxyURL != "" {
372
+ cloneOpts .ProxyOptions = transport.ProxyOptions {
373
+ URL : options .GitHTTPProxyURL ,
374
+ }
375
+ }
366
376
cloneOpts .RepoURL = options .GitURL
367
377
368
378
cloned , fallbackErr = CloneRepo (ctx , cloneOpts )
0 commit comments